summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-05-31 22:42:13 -0700
committerKeith Packard <keithp@keithp.com>2018-05-31 22:42:13 -0700
commitf755181fd3ec82d7644591e2ed4b99a244acfd6e (patch)
tree58eea1dfac38e0b16c3c757467614c3c2a5060d5
parent99642f9c4f89aa5577376a9cd118e7cff26e2762 (diff)
altos/telelco-v2.0: Test displays at power on
At boot, light up all LEDS and LCD segments for a second to let the user verify that things are working correctly. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/telelco-v2.0/ao_lco_v2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/telelco-v2.0/ao_lco_v2.c b/src/telelco-v2.0/ao_lco_v2.c
index 140955da..1be8ecb2 100644
--- a/src/telelco-v2.0/ao_lco_v2.c
+++ b/src/telelco-v2.0/ao_lco_v2.c
@@ -626,6 +626,23 @@ ao_lco_arm_warn(void)
}
}
+/*
+ * Light up everything for a second at power on to let the user
+ * visually inspect the system for correct operation
+ */
+static void
+ao_lco_display_test()
+{
+ ao_mutex_get(&ao_lco_display_mutex);
+ ao_seven_segment_set(AO_LCO_PAD_DIGIT, 8 | 0x10);
+ ao_seven_segment_set(AO_LCO_BOX_DIGIT_1, 8 | 0x10);
+ ao_seven_segment_set(AO_LCO_BOX_DIGIT_10, 8 | 0x10);
+ ao_mutex_put(&ao_lco_display_mutex);
+ ao_led_on(LEDS_AVAILABLE);
+ ao_delay(AO_MS_TO_TICKS(1000));
+ ao_led_off(LEDS_AVAILABLE);
+}
+
static void
ao_lco_batt_voltage(void)
{
@@ -649,6 +666,7 @@ ao_lco_monitor(void)
uint16_t delay;
uint8_t box;
+ ao_lco_display_test();
ao_lco_batt_voltage();
ao_lco_search();
ao_add_task(&ao_lco_input_task, ao_lco_input, "lco input");