altos: Perform time comparisons using 16-bit arithmetic to handle wrap
[fw/altos] / altoslib / AltosEepromRecordMega.java
index 18d435afd7f582c73658c1f7cb2619dcc239188a..ad3e23fdfeeefcbc258354f5941dd6d5c35013b9 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_11;
+package org.altusmetrum.altoslib_12;
 
 public class AltosEepromRecordMega extends AltosEepromRecord {
        public static final int record_length = 32;
@@ -73,8 +73,8 @@ public class AltosEepromRecordMega extends AltosEepromRecord {
        private int gyro_y() { return data16(16); }
        private int gyro_z() { return data16(18); }
        private int mag_x() { return data16(20); }
-       private int mag_y() { return data16(22); }
-       private int mag_z() { return data16(24); }
+       private int mag_z() { return data16(22); }
+       private int mag_y() { return data16(24); }
        private int accel() { return data16(26); }
 
        /* AO_LOG_TEMP_VOLT elements */
@@ -142,8 +142,8 @@ public class AltosEepromRecordMega extends AltosEepromRecord {
                        int     gyro_pitch = gyro_x();
                        int     gyro_yaw = gyro_z();
 
-                       int     mag_along = mag_x();
-                       int     mag_across = mag_y();
+                       int     mag_along = mag_y();
+                       int     mag_across = mag_x();
                        int     mag_through = mag_z();
 
                        if (log_format == AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD)
@@ -249,12 +249,12 @@ public class AltosEepromRecordMega extends AltosEepromRecord {
                return new AltosEepromRecordMega(eeprom, s);
        }
 
-       public AltosEepromRecordMega(AltosEepromNew eeprom, int start) {
+       public AltosEepromRecordMega(AltosEeprom eeprom, int start) {
                super(eeprom, start, record_length);
                log_format = eeprom.config_data().log_format;
        }
 
-       public AltosEepromRecordMega(AltosEepromNew eeprom) {
+       public AltosEepromRecordMega(AltosEeprom eeprom) {
                this(eeprom, 0);
        }
 }