From 19710bae4b9a6b964bb77703fc4f7070a5e2e29f Mon Sep 17 00:00:00 2001 From: Oliver Seiler Date: Sun, 27 Sep 2020 20:39:02 +1300 Subject: [PATCH] Fixing issue #639 in a better way, that ensures TIME_SYNC_INTERVAL_RETRY is used over TIME_SYNC_INTERVAL when GPS time was invalid --- src/timekeeper.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/timekeeper.cpp b/src/timekeeper.cpp index 1c65d9a1..bc9e52b5 100644 --- a/src/timekeeper.cpp +++ b/src/timekeeper.cpp @@ -49,14 +49,10 @@ void calibrateTime(void) { // no RTC -> fallback to GPS time #if (HAS_GPS) t = get_gpstime(&t_msec); - if (t) { - // only set time source to GPS if GPS time was actually valid - timeSource = _gps; - } + timeSource = _gps; #endif - if (t) - setMyTime((uint32_t)t, t_msec, timeSource); // set time + setMyTime((uint32_t)t, t_msec, timeSource); // set time } // fallback