From 414ad2696bbe2a2f245ae7bb2ec8f57bc8cc0097 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 26 Nov 2022 09:48:19 -0800 Subject: [PATCH] ao-tools/ao-eeprom: Add support for TeleMega v5.0 Same as TeleMega v4.0 (ao-eeprom doesn't do much with imu data) Signed-off-by: Keith Packard --- ao-tools/ao-eeprom/ao-eeprom.c | 7 +++++++ ao-tools/lib/ao-eeprom-read.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ao-tools/ao-eeprom/ao-eeprom.c b/ao-tools/ao-eeprom/ao-eeprom.c index ec5f9c4d..d9b33195 100644 --- a/ao-tools/ao-eeprom/ao-eeprom.c +++ b/ao-tools/ao-eeprom/ao-eeprom.c @@ -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: diff --git a/ao-tools/lib/ao-eeprom-read.h b/ao-tools/lib/ao-eeprom-read.h index 11e4f91d..a103824b 100644 --- a/ao-tools/lib/ao-eeprom-read.h +++ b/ao-tools/lib/ao-eeprom-read.h @@ -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 { -- 2.30.2