Fixed bug in gps task which made it setting time and date even whithout GPS fix.

replace/4e95847162e2821a7f3d9f0d905f9f77f1bbfaba
Silvano Seva 2021-03-24 12:28:45 +01:00
rodzic f2f7f6dd51
commit 90122b0c7a
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -66,8 +66,9 @@ void gps_taskFunc(char *line, __attribute__((unused)) int len, state_t *state)
state->gps_data.timestamp.year = frame.date.year;
}
// Synchronize RTC with GPS UTC clock
if((state->settings.gps_set_time) && (!isRtcSyncronised))
// Synchronize RTC with GPS UTC clock, only when fix is done
if((state->settings.gps_set_time) &&
(state->gps_data.fix_quality > 0) && (!isRtcSyncronised))
{
rtc_setTime(state->gps_data.timestamp);
isRtcSyncronised = true;