clean up telefireone name references
[fw/altos] / altoslib / AltosEepromRecordFull.java
index d240da283e131ffbe2db8c21715f0b88c507aec8..fbb8fbd9e7ff14cd528f27f564f5a6c0d8964797 100644 (file)
@@ -19,6 +19,8 @@ public class AltosEepromRecordFull extends AltosEepromRecord {
 
        public static final int max_sat = 12;
 
+       public static final int two_g_default = 16294 - 15758;
+
        public void update_state(AltosState state) {
                super.update_state(state);
                AltosGPS        gps;
@@ -43,6 +45,8 @@ public class AltosEepromRecordFull extends AltosEepromRecord {
                        state.set_state(AltosLib.ao_flight_pad);
                        state.set_ground_accel(data16(0));
                        state.set_flight(data16(2));
+                       if (state.accel_plus_g == AltosLib.MISSING)
+                               state.set_accel_g(data16(0), data16(0) + two_g_default);
                        break;
                case AltosLib.AO_LOG_SENSOR:
                        state.set_accel(data16(0));
@@ -108,9 +112,10 @@ public class AltosEepromRecordFull extends AltosEepromRecord {
        }
 
        public AltosEepromRecord next() {
-               if (start + length + length < eeprom.data.size())
-                       return new AltosEepromRecordFull(eeprom, start + length);
-               return null;
+               int     s = next_start();
+               if (s < 0)
+                       return null;
+               return new AltosEepromRecordFull(eeprom, s);
        }
 
        public AltosEepromRecordFull(AltosEepromNew eeprom, int start) {