GPS time sync only if GPS time is valid

This commit is contained in:
cyberman54 2021-04-07 21:21:06 +02:00
parent c2336397ce
commit 3268824eb5

View File

@ -164,7 +164,7 @@ void gps_loop(void *pvParameters) {
// (only) while device time is not set or unsynched, and we have a valid // (only) while device time is not set or unsynched, and we have a valid
// GPS time, we trigger a device time update to poll time from GPS // GPS time, we trigger a device time update to poll time from GPS
if ((timeSource == _unsynced || timeSource == _set) && if ((timeSource == _unsynced || timeSource == _set) &&
gpstime.isUpdated()) { (gpstime.isUpdated() && gpstime.isValid() && gpstime.age() < 1000)) {
now(); now();
calibrateTime(); calibrateTime();
} }