From 0ca9a7c6fc914c4b555c99863828861ec54fa01d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 20 Feb 2020 22:44:54 -0800 Subject: [PATCH] ao-tools: Add TeleMega v4.0 to ao-eeprom Signed-off-by: Keith Packard --- ao-tools/ao-eeprom/ao-eeprom.c | 11 +++++++++++ ao-tools/lib/ao-eeprom-read.h | 1 + 2 files changed, 12 insertions(+) diff --git a/ao-tools/ao-eeprom/ao-eeprom.c b/ao-tools/ao-eeprom/ao-eeprom.c index 91a6ccb3..2f076242 100644 --- a/ao-tools/ao-eeprom/ao-eeprom.c +++ b/ao-tools/ao-eeprom/ao-eeprom.c @@ -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: diff --git a/ao-tools/lib/ao-eeprom-read.h b/ao-tools/lib/ao-eeprom-read.h index 82893f24..e4a9b0cc 100644 --- a/ao-tools/lib/ao-eeprom-read.h +++ b/ao-tools/lib/ao-eeprom-read.h @@ -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 { -- 2.30.2