summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-05-28 14:54:47 -0700
committerKeith Packard <keithp@keithp.com>2018-05-28 14:54:47 -0700
commit29f9880f7b09bc135d34bf0dcb221bdede7726b3 (patch)
treef20d207e3f0db3c64c45824ca0bc04df10e38a6c /src
parent98ea690cc7514f43254f3a6c72668c11820f657c (diff)
altos/telelco-v2.0: A bit fancier with the drag-mode LED show
Continutity leds now show whether the pad is included in the drag race *and* the continutity using four different patterns: Drag select & igniter present: long on, short off Drag select & igniter missing: short on, long off Not select & igniter present: solid on Not select & igniter missing: solid off Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/telelco-v2.0/ao_lco_v2.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/telelco-v2.0/ao_lco_v2.c b/src/telelco-v2.0/ao_lco_v2.c
index cc6ab13a..d78f54d2 100644
--- a/src/telelco-v2.0/ao_lco_v2.c
+++ b/src/telelco-v2.0/ao_lco_v2.c
@@ -581,23 +581,32 @@ ao_lco_igniter_status(void)
for (c = 0; c < AO_LED_CONTINUITY_NUM; c++) {
uint8_t status;
- if (ao_lco_drag_race) {
- if (ao_lco_selected[ao_lco_box] & (1 << c) && t)
+ if (ao_pad_query.channels & (1 << c))
+ status = ao_pad_query.igniter_status[c];
+ else
+ status = AO_PAD_IGNITER_STATUS_NO_IGNITER_RELAY_OPEN;
+
+ if (ao_lco_drag_race && (ao_lco_selected[ao_lco_box] & (1 << c))) {
+ uint8_t on = 0;
+ if (status == AO_PAD_IGNITER_STATUS_GOOD_IGNITER_RELAY_OPEN) {
+ if (t)
+ on = 1;
+ } else {
+ if (!t)
+ on = 1;
+ }
+ if (on)
ao_led_on(continuity_led[c]);
else
ao_led_off(continuity_led[c]);
} else {
- if (ao_pad_query.channels & (1 << c))
- status = ao_pad_query.igniter_status[c];
- else
- status = AO_PAD_IGNITER_STATUS_NO_IGNITER_RELAY_OPEN;
if (status == AO_PAD_IGNITER_STATUS_GOOD_IGNITER_RELAY_OPEN)
ao_led_on(continuity_led[c]);
else
ao_led_off(continuity_led[c]);
}
}
- t = 1-t;
+ t = (t + 1) & 3;
}
}