From 2efb997865ee46bf0e8d5145c95d051a7656222a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 11 Dec 2017 14:42:45 -0800 Subject: [PATCH] altoslib: Keep old GPS values when updating data This way, updating satellite information doesn't drop all of the regular GPS data on the floor. Signed-off-by: Keith Packard --- altoslib/AltosCalData.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index fdea5e21..03e2cbd7 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -241,6 +241,8 @@ public class AltosCalData { public AltosGPS gps_pad = null; + public AltosGPS prev_gps = null; + public double gps_pad_altitude = AltosLib.MISSING; public void set_cal_gps(AltosGPS gps) { @@ -251,6 +253,7 @@ public class AltosCalData { gps_pad_altitude = gps.alt; } temp_gps = null; + prev_gps = gps; } /* @@ -275,7 +278,7 @@ public class AltosCalData { public AltosGPS make_temp_cal_gps(int tick, boolean sats) { if (temp_gps == null) - temp_gps = new AltosGPS(); + temp_gps = new AltosGPS(prev_gps); if (sats) { if (tick != temp_gps_sat_tick) temp_gps.cc_gps_sat = null; -- 2.30.2