Merge pull request #3801 from AlexandrTyshchenko/feature/gps-guard-time-wait

GPS guard: show "time wait" instead of "rej nofix" between fixes
This commit is contained in:
fdlamotte authored and GitHub committed 2026-11-11 10:13:11 -04:00
commit c4258a5beb
2 files changed
+6 -5

No files matched your search

+5 -4
View File
@@ -280,16 +280,17 @@ public:
return true;
}
// e.g. "ok 7sat time ok +1s", "rej region time rej nofix",
// e.g. "ok 7sat time ok +1s", "ok 7sat time wait", "rej region time rej nofix",
// "ok 9sat time rej step 3600s ALERT gps-clk +3600s 75m"
void formatStatus(char* out, size_t out_size) const {
if (!_enabled) {
snprintf(out, out_size, "off");
return;
}
// The time status is only refreshed when a sync is due: without a current trusted fix,
// do not keep showing an old "ok" as if GPS time were usable now.
const char* time_status = (_time_status[0] == 'o' && !trustedFixIsCurrent()) ? "rej nofix" : _time_status;
// The time status is only refreshed when a sync is due. Without a current trusted fix
// (e.g. GPS asleep between periodic fixes) an old "ok" is not shown as current: the last
// check passed and the next one waits for a trusted fix.
const char* time_status = (_time_status[0] == 'o' && !trustedFixIsCurrent()) ? "wait" : _time_status;
if (_time_alert) {
snprintf(out, out_size, "%s time %s ALERT gps-clk %+lds %lum", _fix_status, time_status,
_time_disagree_offset, (unsigned long)((uint32_t)(millis() - _time_disagree_since_ms) / 60000));