From: Keith Packard Date: Wed, 9 Jan 2013 23:23:46 +0000 (-0800) Subject: altoslib: Don't smash existing GPS pad alt after boost X-Git-Tag: 1.1.9.3~8^2~12 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=42733d2823b1ecf54c03881fc120067868c0ff4c altoslib: Don't smash existing GPS pad alt after boost Leave the existing GPS pad altitude value in place after boost by checking to see if it was ever computed before resetting it to the barometric pad altitude. This makes GPS height values relative to the pad. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 218c598a..4f59c840 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -200,10 +200,10 @@ public class AltosState { } ngps++; } - } else - pad_alt = ground_altitude; - - data.new_gps = false; + } else { + if (ngps == 0) + pad_alt = ground_altitude; + } gps_waiting = MIN_PAD_SAMPLES - npad; if (gps_waiting < 0)