altoslib: Adjust boost/landed time in flight series for display
[fw/altos] / altoslib / AltosEepromRecord.java
index 08f7ebcad68922caaee2f1659d275f867fcb66dc..7a0cc8f92ac4be3d89d3b21e43fbc248450f0a3e 100644 (file)
@@ -87,12 +87,21 @@ public abstract class AltosEepromRecord implements Comparable<AltosEepromRecord>
                if (cmd() == AltosLib.AO_LOG_FLIGHT)
                        cal_data.set_boost_tick();
                listener.set_time(cal_data.time());
+
+               /* Flush any pending GPS changes */
+               if (!AltosLib.is_gps_cmd(cmd())) {
+                       AltosGPS gps = cal_data.temp_gps();
+                       if (gps != null) {
+                               listener.set_gps(gps);
+                               cal_data.reset_temp_gps();
+                       }
+               }
        }
 
        public int next_start() {
                int     s = start + length;
 
-               while (s + length < eeprom.data.size()) {
+               while (s + length <= eeprom.data.size()) {
                        if (valid(s))
                                return s;
                        s += length;