Plane: log GPS messages as they come in

stops us logging duplicate messages
This commit is contained in:
Andrew Tridgell 2013-04-28 14:56:31 +10:00
parent 786e4cf705
commit b53e3bb1fc

View File

@ -881,9 +881,6 @@ static void medium_loop()
if (g.log_bitmask & MASK_LOG_NTUN)
Log_Write_Nav_Tuning();
if (g.log_bitmask & MASK_LOG_GPS)
Log_Write_GPS();
break;
// This case controls the slow loop
@ -972,9 +969,17 @@ static void one_second_loop()
static void update_GPS(void)
{
static uint32_t last_gps_reading;
g_gps->update();
update_GPS_light();
if (g_gps->last_message_time_ms() != last_gps_reading) {
last_gps_reading = g_gps->last_message_time_ms();
if (g.log_bitmask & MASK_LOG_GPS) {
Log_Write_GPS();
}
}
// get position from AHRS
have_position = ahrs.get_position(&current_loc);