From: Keith Packard Date: Fri, 4 Oct 2024 04:45:11 +0000 (-0700) Subject: telegps-v4.0-seeed: Use simpler failure indicators X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=25ddaa29d6a86046b4beb4f4305c921219067c57;p=fw%2Faltos telegps-v4.0-seeed: Use simpler failure indicators panic with one blink - flash check failed panic with two blinks - battery voltage check failed panic with three blinks - gps check failed steady LED - success Signed-off-by: Keith Packard --- diff --git a/src/telegps-v4.0-seeed/ao_telegps_seeed.c b/src/telegps-v4.0-seeed/ao_telegps_seeed.c index ae7c9b12..18dee5d6 100644 --- a/src/telegps-v4.0-seeed/ao_telegps_seeed.c +++ b/src/telegps-v4.0-seeed/ao_telegps_seeed.c @@ -21,6 +21,10 @@ #include #include +#define AO_FAIL_FLASH 1 +#define AO_FAIL_ADC 2 +#define AO_FAIL_GPS 3 + static void ao_validate(void) { @@ -34,7 +38,7 @@ ao_validate(void) /* Check the flash part */ ao_storage_setup(); if (ao_storage_total != 2 * 1024 * 1024) - ao_panic(AO_PANIC_FLASH); + ao_panic(AO_FAIL_FLASH); /* Check the battery voltage */ data = ao_data_head; @@ -43,7 +47,7 @@ ao_validate(void) } while (ao_data_head == data); decivolt = ao_battery_decivolt(ao_data_ring[data].adc.v_batt); if (decivolt < 35 && 55 < decivolt) - ao_panic(AO_PANIC_ADC); + ao_panic(AO_FAIL_ADC); /* Check to make sure GPS data is being received */ gps_start = ao_time(); @@ -63,9 +67,10 @@ ao_validate(void) break; } if ((AO_TICK_SIGNED) (ao_time() - gps_start) > (AO_TICK_SIGNED) AO_SEC_TO_TICKS(10)) - ao_panic(AO_PANIC_CRASH); + ao_panic(AO_FAIL_GPS); } ao_led_on(LEDS_AVAILABLE); + ao_exit(); } struct ao_task ao_validate_task;