diff options
author | Keith Packard <keithp@keithp.com> | 2014-09-03 22:12:15 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-03 22:12:15 -0700 |
commit | adc46e2f1346d98ef4f6c2351fef95fbc8ddf831 (patch) | |
tree | f51022dbc5e5530b6e286b7153070a959b7c96fd | |
parent | b838a974d0dad43ff02060d8d913d9369eb20e96 (diff) |
altos/telefire: Add firing length to manual pad command
This adds an optional length of time (in 1/10s of a second) to the
ao_pad_manual function to enable testing of igniters without needing
to use TeleLCO.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/drivers/ao_pad.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/drivers/ao_pad.c b/src/drivers/ao_pad.c index 144cbd70..dc2c83fe 100644 --- a/src/drivers/ao_pad.c +++ b/src/drivers/ao_pad.c @@ -362,14 +362,26 @@ ao_pad_test(void) void ao_pad_manual(void) { + uint8_t ignite; + int repeat; ao_cmd_white(); if (!ao_match_word("DoIt")) return; ao_cmd_decimal(); if (ao_cmd_status != ao_cmd_success) return; - ao_pad_ignite = 1 << ao_cmd_lex_i; - ao_wakeup(&ao_pad_ignite); + ignite = 1 << ao_cmd_lex_i; + ao_cmd_decimal(); + if (ao_cmd_status != ao_cmd_success) { + repeat = 1; + ao_cmd_status = ao_cmd_success; + } else + repeat = ao_cmd_lex_i; + while (repeat-- > 0) { + ao_pad_ignite = ignite; + ao_wakeup(&ao_pad_ignite); + ao_delay(AO_PAD_FIRE_TIME>>1); + } } static __xdata struct ao_task ao_pad_task; |