From d317c2e30c408909807bde7c5577e499bd3c6f17 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 16 Dec 2021 13:37:17 -0800 Subject: [PATCH] ao-tools/ao-test-igniter: Deal with devices that use both 'apogee' for ADC Some devices report drogue igniter ADC value with 'apogee' tag. Deal with this. Signed-off-by: Keith Packard --- ao-tools/ao-test-igniter/ao-test-igniter.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ao-tools/ao-test-igniter/ao-test-igniter.c b/ao-tools/ao-test-igniter/ao-test-igniter.c index 17d5aad6..180defdb 100644 --- a/ao-tools/ao-test-igniter/ao-test-igniter.c +++ b/ao-tools/ao-test-igniter/ao-test-igniter.c @@ -82,6 +82,16 @@ map_igniter_name(char *adc_name, char *igniter_name) return true; } +static const char * +other_igniter_name(const char *name) +{ + if (!strcmp(name, "drogue")) + return "apogee"; + if (!strcmp(name, "apogee")) + return "drogue"; + return name; +} + static struct igniter * igniters(struct cc_usb *usb) { @@ -115,7 +125,9 @@ igniters(struct cc_usb *usb) if (found_igniter) { struct igniter *i; for (i = head; i; i = i->next) - if (!strcmp(i->name, igniter_name)) { + if (!strcmp(i->name, igniter_name) || + !strcmp(i->name, other_igniter_name(igniter_name))) + { i->adc = atoi(tok); break; } -- 2.30.2