Fixed missing gps updates due to recording an update even when one wasn't detected, this meant countdown would restart errantly.

md1702
vk7js 2022-09-15 18:40:11 +10:00 zatwierdzone przez Silvano Seva
rodzic dbc86ea392
commit cf45f7ee81
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -1136,7 +1136,7 @@ void ui_saveState()
#ifdef GPS_PRESENT
static float priorGPSSpeed = 0;
static float priorGPSAltitude = 0;
static float priorGPSDirection = 0;
static float priorGPSDirection = 500; // impossible value init.
static uint32_t vpGPSLastUpdate = 0;
static vpGPSInfoFlags_t GetGPSDirectionOrSpeedChanged()
@ -1150,8 +1150,6 @@ static vpGPSInfoFlags_t GetGPSDirectionOrSpeedChanged()
if (now - vpGPSLastUpdate < 10000)
return vpGPSNone;
vpGPSLastUpdate=now;
vpGPSInfoFlags_t whatChanged= vpGPSNone;
if (state.gps_data.fix_quality != priorGPSFixQuality)
@ -1187,6 +1185,9 @@ static vpGPSInfoFlags_t GetGPSDirectionOrSpeedChanged()
priorGPSDirection = state.gps_data.tmg_true;
}
if (whatChanged)
vpGPSLastUpdate=now;
return whatChanged;
}
#endif // GPS_PRESENT