diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-06 18:25:15 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-06 18:25:15 -0700 |
commit | d4b1dffeef3e9ea96e143f74782e4da7d116c0d4 (patch) | |
tree | 9056ee5a7551332cc11a5b199fe50ec642c2591a | |
parent | 2cac8c572ce533ded89dae9a412b4d1b5c748342 (diff) |
altos/telefire: Make sure armed alarm goes off on time
Instead of turning the alarm off when a packet is received after the
deadline, just do it in the thread which is awake all of the time.
This prevents the alarm from sticking on when the LCO box is turned
off while the arming key is on.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/drivers/ao_pad.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/ao_pad.c b/src/drivers/ao_pad.c index 55e6289d..120ce539 100644 --- a/src/drivers/ao_pad.c +++ b/src/drivers/ao_pad.c @@ -139,6 +139,9 @@ ao_pad_monitor(void) prev = cur; } + if (ao_pad_armed && (int16_t) (ao_time() - ao_pad_arm_time) > AO_PAD_ARM_TIME) + ao_pad_armed = 0; + if (ao_pad_armed) { if (sample & 2) ao_beep(AO_BEEP_HIGH); @@ -197,9 +200,6 @@ ao_pad(void) PRINTD ("tick %d box %d cmd %d channels %02x\n", command.tick, command.box, command.cmd, command.channels); - if (ao_pad_armed && (int16_t) (ao_time() - ao_pad_arm_time) > AO_PAD_ARM_TIME) - ao_pad_armed = 0; - switch (command.cmd) { case AO_LAUNCH_ARM: if (command.box != ao_pad_box) { |