mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 14:42:05 +00:00
Separate GPS and NTP RTCQuality logic and allow GPS time to always set us (#4721)
This commit is contained in:
parent
4b5bcf52d2
commit
11378325e0
@ -124,8 +124,11 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpdate)
|
|||||||
} else if (q > currentQuality) {
|
} else if (q > currentQuality) {
|
||||||
shouldSet = true;
|
shouldSet = true;
|
||||||
LOG_DEBUG("Upgrading time to quality %s\n", RtcName(q));
|
LOG_DEBUG("Upgrading time to quality %s\n", RtcName(q));
|
||||||
} else if (q >= RTCQualityNTP && (now - lastSetMsec) > (12 * 60 * 60 * 1000UL)) {
|
} else if (q == RTCQualityGPS) {
|
||||||
// Every 12 hrs we will slam in a new GPS or Phone GPS / NTP time, to correct for local RTC clock drift
|
shouldSet = true;
|
||||||
|
LOG_DEBUG("Reapplying GPS time: %ld secs\n", printableEpoch);
|
||||||
|
} else if (q == RTCQualityNTP && (now - lastSetMsec) > (12 * 60 * 60 * 1000UL)) {
|
||||||
|
// Every 12 hrs we will slam in a new NTP or Phone GPS / NTP time, to correct for local RTC clock drift
|
||||||
shouldSet = true;
|
shouldSet = true;
|
||||||
LOG_DEBUG("Reapplying external time to correct clock drift %ld secs\n", printableEpoch);
|
LOG_DEBUG("Reapplying external time to correct clock drift %ld secs\n", printableEpoch);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user