mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-15 17:42:12 +00:00
fix a rare GPS data corruption condition (#890)
* fix a rare GPS data corruption condition * don't use hasLock to determine validity
This commit is contained in:
parent
d0fb363422
commit
a914ee133c
@ -206,7 +206,7 @@ void GPS::publishUpdate()
|
|||||||
|
|
||||||
// Notify any status instances that are observing us
|
// Notify any status instances that are observing us
|
||||||
const meshtastic::GPSStatus status =
|
const meshtastic::GPSStatus status =
|
||||||
meshtastic::GPSStatus(hasLock(), isConnected(), latitude, longitude, altitude, dop, heading, numSatellites);
|
meshtastic::GPSStatus(hasValidLocation, isConnected(), latitude, longitude, altitude, dop, heading, numSatellites);
|
||||||
newStatus.notifyObservers(&status);
|
newStatus.notifyObservers(&status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,13 +209,13 @@ NodeInfo *MeshService::refreshMyNodeInfo()
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused)
|
int MeshService::onGPSChanged(const meshtastic::GPSStatus *newStatus)
|
||||||
{
|
{
|
||||||
// Update our local node info with our position (even if we don't decide to update anyone else)
|
// Update our local node info with our position (even if we don't decide to update anyone else)
|
||||||
NodeInfo *node = refreshMyNodeInfo();
|
NodeInfo *node = refreshMyNodeInfo();
|
||||||
Position pos = node->position;
|
Position pos = node->position;
|
||||||
|
|
||||||
if (gps->hasLock()) {
|
if (newStatus->getHasLock()) {
|
||||||
if (gps->altitude != 0)
|
if (gps->altitude != 0)
|
||||||
pos.altitude = gps->altitude;
|
pos.altitude = gps->altitude;
|
||||||
pos.latitude_i = gps->latitude;
|
pos.latitude_i = gps->latitude;
|
||||||
|
Loading…
Reference in New Issue
Block a user