|
|
|
@ -191,6 +191,9 @@ static int32_t pitch_limit_min_cd;
@@ -191,6 +191,9 @@ static int32_t pitch_limit_min_cd;
|
|
|
|
|
|
|
|
|
|
// All GPS access should be through this pointer. |
|
|
|
|
static GPS *g_gps; |
|
|
|
|
#if GPS2_ENABLE |
|
|
|
|
static GPS *g_gps2; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// flight modes convenience array |
|
|
|
|
static AP_Int8 *flight_modes = &g.flight_mode1; |
|
|
|
@ -226,6 +229,9 @@ static AP_Compass_HIL compass;
@@ -226,6 +229,9 @@ static AP_Compass_HIL compass;
|
|
|
|
|
// GPS selection |
|
|
|
|
#if GPS_PROTOCOL == GPS_PROTOCOL_AUTO |
|
|
|
|
AP_GPS_Auto g_gps_driver(&g_gps); |
|
|
|
|
#if GPS2_ENABLE |
|
|
|
|
AP_GPS_UBLOX g_gps2_driver; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#elif GPS_PROTOCOL == GPS_PROTOCOL_NMEA |
|
|
|
|
AP_GPS_NMEA g_gps_driver; |
|
|
|
@ -1021,12 +1027,26 @@ static void update_GPS_50Hz(void)
@@ -1021,12 +1027,26 @@ static void update_GPS_50Hz(void)
|
|
|
|
|
{ |
|
|
|
|
static uint32_t last_gps_reading; |
|
|
|
|
g_gps->update(); |
|
|
|
|
|
|
|
|
|
if (g_gps->last_message_time_ms() != last_gps_reading) { |
|
|
|
|
last_gps_reading = g_gps->last_message_time_ms(); |
|
|
|
|
if (should_log(MASK_LOG_GPS)) { |
|
|
|
|
Log_Write_GPS(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if GPS2_ENABLE |
|
|
|
|
static uint32_t last_gps2_reading; |
|
|
|
|
if (g_gps2 != NULL) { |
|
|
|
|
g_gps2->update(); |
|
|
|
|
if (g_gps2->last_message_time_ms() != last_gps2_reading) { |
|
|
|
|
last_gps2_reading = g_gps2->last_message_time_ms(); |
|
|
|
|
if (g.log_bitmask & MASK_LOG_GPS) { |
|
|
|
|
DataFlash.Log_Write_GPS2(g_gps2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|