altos: Use fast timer for buttons instead of edge-triggered ISR
authorKeith Packard <keithp@keithp.com>
Tue, 13 Aug 2019 00:30:48 +0000 (17:30 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 13 Aug 2019 00:30:48 +0000 (17:30 -0700)
If the button bounces between the triggering interrupt and the button
state check, we could lose the final state change of the button and
send an incorrect event to the application. In the worst case, the button
would end up in exactly the wrong state, toggling in the wrong direction.

Use the fast timer to poll all buttons instead so that there is only
one check of each button at each poll interval (instead of the
interrupt and the state check). This makes buttons reliably debounced.

Signed-off-by: Keith Packard <keithp@keithp.com>

No differences found