From: Keith Packard Date: Thu, 16 Dec 2021 21:37:17 +0000 (-0800) Subject: ao-tools/ao-test-igniter: Deal with devices that use both 'apogee' for ADC X-Git-Tag: 1.9.10.4~64 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=d317c2e30c408909807bde7c5577e499bd3c6f17 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 --- 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; }