GPS time sync only if GPS time is valid
This commit is contained in:
parent
c2336397ce
commit
3268824eb5
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user