ao-tools: Add TeleMega v4.0 to ao-eeprom
authorKeith Packard <keithp@keithp.com>
Fri, 21 Feb 2020 06:44:54 +0000 (22:44 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 21 Feb 2020 06:44:54 +0000 (22:44 -0800)
Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-eeprom/ao-eeprom.c
ao-tools/lib/ao-eeprom-read.h

index 91a6ccb352ac1740da8f89280dcdbc3c2769cfeb..2f0762420432fece69f082c618a6a0a20b296bbf 100644 (file)
@@ -351,6 +351,16 @@ main (int argc, char **argv)
                case AO_LOG_FORMAT_MICROPEAK2:
                        len = 2;
                        break;
+               case AO_LOG_FORMAT_TELEMEGA_4:
+                       len = 32;
+                       break;
+                       max_adc= 4095;
+                       adc_ref = 3.3;
+                       batt_r1 = 5600;
+                       batt_r2 = 10000;
+                       sense_r1 = 100e3;
+                       sense_r2 = 27e3;
+                       break;
                }
                if (arg_len)
                        len = arg_len;
@@ -398,6 +408,7 @@ main (int argc, char **argv)
                                case AO_LOG_FORMAT_TELEMEGA:
                                case AO_LOG_FORMAT_TELEMEGA_3:
                                case AO_LOG_FORMAT_EASYMEGA_2:
+                               case AO_LOG_FORMAT_TELEMEGA_4:
                                        log_mega = (struct ao_log_mega *) &eeprom->data[pos];
                                        switch (log_mega->type) {
                                        case AO_LOG_FLIGHT:
index 82893f246638481005a5989d148b2457068c1d86..e4a9b0ccba23b171bea671a4d2407bf0ed45a618 100644 (file)
@@ -44,6 +44,7 @@
 #define AO_LOG_FORMAT_EASYMEGA_2       16      /* 32 byte typed telemega records with 32 bit gyro cal, mpu9250 rotated 90° and adxl375 */
 #define AO_LOG_FORMAT_TELESTATIC       17      /* 32 byte typed telestatic records */
 #define AO_LOG_FORMAT_MICROPEAK2       18      /* 2-byte baro values with header */
+#define AO_LOG_FORMAT_TELEMEGA_4       19      /* 32 byte typed telemega records with 32 bit gyro cal and Bmx160 */
 #define AO_LOG_FORMAT_NONE             127     /* No log at all */
 
 enum ao_pyro_flag {