From 3268824eb5e03aca51f53d3e3ccb6e23576260ba Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 7 Apr 2021 21:21:06 +0200 Subject: [PATCH] GPS time sync only if GPS time is valid --- src/gpsread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpsread.cpp b/src/gpsread.cpp index 7801a4ce..79c0847d 100644 --- a/src/gpsread.cpp +++ b/src/gpsread.cpp @@ -164,7 +164,7 @@ void gps_loop(void *pvParameters) { // (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 if ((timeSource == _unsynced || timeSource == _set) && - gpstime.isUpdated()) { + (gpstime.isUpdated() && gpstime.isValid() && gpstime.age() < 1000)) { now(); calibrateTime(); }