Try-fix: L76K spamming bad times can crash nodes (#7261)

* Try-fix: Clear GPS buffer when we encounter a bad time in NMEA

* Fix signed int warnings
This commit is contained in:
Ben Meadors
2025-07-07 19:35:57 -05:00
committed by GitHub
parent f2fb473ecf
commit 415dc4aa47
4 changed files with 27 additions and 12 deletions
+4 -1
View File
@@ -1536,7 +1536,10 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
if (t.tm_mon > -1) {
LOG_DEBUG("NMEA GPS time %02d-%02d-%02d %02d:%02d:%02d age %d", d.year(), d.month(), t.tm_mday, t.tm_hour, t.tm_min,
t.tm_sec, ti.age());
perhapsSetRTC(RTCQualityGPS, t);
if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultInvalidTime) {
// Clear the GPS buffer if we got an invalid time
clearBuffer();
}
return true;
} else
return false;