ao-tools/ao-eeprom: Add support for TeleMega v5.0
authorKeith Packard <keithp@keithp.com>
Sat, 26 Nov 2022 17:48:19 +0000 (09:48 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 26 Nov 2022 17:51:26 +0000 (09:51 -0800)
Same as TeleMega v4.0 (ao-eeprom doesn't do much with imu data)

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-eeprom/ao-eeprom.c
ao-tools/lib/ao-eeprom-read.h

index ec5f9c4da932c91785ad7d20d995993bb45efc3e..d9b331953d35bd84677046fbe98940d71096e13f 100644 (file)
@@ -354,6 +354,7 @@ main (int argc, char **argv)
                        len = 2;
                        break;
                case AO_LOG_FORMAT_TELEMEGA_4:
+               case AO_LOG_FORMAT_TELEMEGA_5:
                        len = 32;
                        max_adc= 4095;
                        adc_ref = 3.3;
@@ -375,6 +376,11 @@ main (int argc, char **argv)
                }
                if (arg_len)
                        len = arg_len;
+               if (len == 0) {
+                       fprintf(stderr, "Unknown eeprom format %d and no specified length\n",
+                               eeprom->log_format);
+                       exit(1);
+               }
                if (verbose)
                        printf("config major %d minor %d log format %d total %u len %d\n",
                               eeprom->config.major,
@@ -421,6 +427,7 @@ main (int argc, char **argv)
                                case AO_LOG_FORMAT_TELEMEGA_3:
                                case AO_LOG_FORMAT_EASYMEGA_2:
                                case AO_LOG_FORMAT_TELEMEGA_4:
+                               case AO_LOG_FORMAT_TELEMEGA_5:
                                        log_mega = (struct ao_log_mega *) &eeprom->data[pos];
                                        switch (log_mega->type) {
                                        case AO_LOG_FLIGHT:
index 11e4f91d92e0fe6f9daa13b1ff9828ac55de91a9..a103824b35bfd148556f3d38d223351d6e94d2b4 100644 (file)
@@ -46,6 +46,7 @@
 #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_EASYMOTOR                20      /* 16 byte typed easymotor records with pressure sensor and adxl375 */
+#define AO_LOG_FORMAT_TELEMEGA_5       21      /* 32 byte typed telemega records with 32 bit gyro cal, mpu6000 and mmc5983 */
 #define AO_LOG_FORMAT_NONE             127     /* No log at all */
 
 enum ao_pyro_flag {