Fixing issue #639 in a better way, that ensures TIME_SYNC_INTERVAL_RETRY is used over TIME_SYNC_INTERVAL when GPS time was invalid

This commit is contained in:
Oliver Seiler 2020-09-27 20:39:02 +13:00
parent 53570d7ccf
commit 19710bae4b

View File

@ -49,13 +49,9 @@ void calibrateTime(void) {
// no RTC -> fallback to GPS time // no RTC -> fallback to GPS time
#if (HAS_GPS) #if (HAS_GPS)
t = get_gpstime(&t_msec); t = get_gpstime(&t_msec);
if (t) {
// only set time source to GPS if GPS time was actually valid
timeSource = _gps; timeSource = _gps;
}
#endif #endif
if (t)
setMyTime((uint32_t)t, t_msec, timeSource); // set time setMyTime((uint32_t)t, t_msec, timeSource); // set time
} // fallback } // fallback