diff options
author | Keith Packard <keithp@keithp.com> | 2011-10-27 00:49:23 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-27 00:49:23 -0700 |
commit | 0669f0d74fc24c4f1925a45a9975b7a49a65b692 (patch) | |
tree | 5b2bef044755a081f1edce5fd27f31edb2f8ab88 /altosui/AltosState.java | |
parent | c7e14a2750d437e8b77d68a944a0711e7a0c882b (diff) |
altosui: Only update GPS data when new GPS information arrives
Track which telemetry packets are actually producing new GPS
information and only update the GPS average position and count of
stable GPS reports with new GPS info, instead of on every telemetry packet.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosState.java')
-rw-r--r-- | altosui/AltosState.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/altosui/AltosState.java b/altosui/AltosState.java index 3d8e5e12..da498bc1 100644 --- a/altosui/AltosState.java +++ b/altosui/AltosState.java @@ -135,7 +135,7 @@ public class AltosState { time = tick / 100.0; - if (state == Altos.ao_flight_pad || state == Altos.ao_flight_idle) { + if (cur.new_gps && (state == Altos.ao_flight_pad || state == Altos.ao_flight_idle)) { /* Track consecutive 'good' gps reports, waiting for 10 of them */ if (data.gps != null && data.gps.locked && data.gps.nsat >= 4) |