- Bounds Check is working on big integers, don't throw away valid coordinates.

- Set ublox chips back to NMEA mode if they have been configured wrongly before.
This commit is contained in:
Thomas Göttgens
2022-04-26 13:00:11 +02:00
parent d640478289
commit 701707a01b
5 changed files with 67 additions and 7 deletions

View File

@@ -129,10 +129,16 @@ bool NMEAGPS::lookForLocation()
auto loc = reader.location.value();
// Bail out EARLY to avoid overwriting previous good data (like #857)
if((toDegInt(loc.lat) == 0) || (toDegInt(loc.lat) > 90)) {
if (toDegInt(loc.lat) > 900000000) {
#ifdef GPS_EXTRAVERBOSE
DEBUG_MSG("Bail out EARLY on LAT %i\n",toDegInt(loc.lat));
#endif
return false;
}
if((toDegInt(loc.lng) == 0) || (toDegInt(loc.lng) > 180)) {
if (toDegInt(loc.lng) > 1800000000) {
#ifdef GPS_EXTRAVERBOSE
DEBUG_MSG("Bail out EARLY on LNG %i\n",toDegInt(loc.lng));
#endif
return false;
}