From deb3336729c480dfa8b711a4fcfe0195ce2d5d0f Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 14 Apr 2012 14:02:20 -0500 Subject: [PATCH] Make sure for revolution all the GPS objects are always initialized even if there is no GPS port. Otherwise connecting to relevant queues will fail. --- flight/Modules/GPS/GPS.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/flight/Modules/GPS/GPS.c b/flight/Modules/GPS/GPS.c index eeb4e1a4a..1754f61d3 100644 --- a/flight/Modules/GPS/GPS.c +++ b/flight/Modules/GPS/GPS.c @@ -138,6 +138,17 @@ int32_t GPSInitialize(void) gpsEnabled = false; #endif +#if defined(REVOLUTION) + // Revolution expects these objects to always be defined. Not doing so will fail some + // queue connections in navigation + GPSPositionInitialize(); + GPSVelocityInitialize(); + GPSTimeInitialize(); + GPSSatellitesInitialize(); + HomeLocationInitialize(); + updateSettings(); + +#else if (gpsPort && gpsEnabled) { GPSPositionInitialize(); GPSVelocityInitialize(); @@ -149,7 +160,10 @@ int32_t GPSInitialize(void) HomeLocationInitialize(); #endif updateSettings(); + } +#endif + if (gpsPort && gpsEnabled) { gps_rx_buffer = pvPortMalloc(NMEA_MAX_PACKET_LENGTH); PIOS_Assert(gps_rx_buffer);