Skip to content

Commit

Permalink
Fixing issue cyberman54#639 in a better way, that ensures TIME_SYNC_I…
Browse files Browse the repository at this point in the history
…NTERVAL_RETRY is used over TIME_SYNC_INTERVAL when GPS time was invalid
  • Loading branch information
oseiler2 committed Sep 27, 2020
1 parent 53570d7 commit 19710ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/timekeeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 19710ba

Please sign in to comment.