prevent sonde pos to change to 0 when the frame is invalid. fixes #2862 (#2869)

This commit is contained in:
Totoo 2025-11-18 12:07:40 +01:00 committed by GitHub
parent c46cc431c9
commit 43a5163b77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -174,10 +174,11 @@ void SondeView::on_packet(const sonde::Packet& packet) {
gps_info = packet.get_GPS_data();
geopos.set_altitude(gps_info.alt);
geopos.set_lat(gps_info.lat);
geopos.set_lon(gps_info.lon);
if (gps_info.lat != 0 && gps_info.lon != 0) { // only update when valid, to prevent flashing
geopos.set_altitude(gps_info.alt);
geopos.set_lat(gps_info.lat);
geopos.set_lon(gps_info.lon);
}
if (logger && logging) {
logger->on_packet(packet);
}