summaryrefslogtreecommitdiff
path: root/src/drivers/ao_button.c
Commit message (Collapse)AuthorAge
* altos: Use fast timer for buttons instead of edge-triggered ISRKeith Packard2019-08-12
| | | | | | | | | | | | | 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>
* altos: Eliminate 'pin' field from GPIO functionsKeith Packard2018-10-13
| | | | | | | This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_button.c: Support up to 16 buttonsKeith Packard2018-05-28
| | | | | | TeleLCO v2.0 has more than 4 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow buttons to be high when pressed rather than lowKeith Packard2017-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'ao_button_get' to button driverKeith Packard2016-08-02
| | | | | | | This returns the current state of the button; useful to check what the value is at startup. Signed-off-by: Keith Packard <keithp@keithp.com>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use simpler debounce logic for buttonsKeith Packard2016-04-19
| | | | | | | | | | | Instead of waiting for a while after the transition to decide if it has stuck, signal the event right away and then ignore other transitions for the debounce interval. This seems to work just as reliably, but has the benefit of eliminating button latency at press time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add default button return value from ao_button_getKeith Packard2013-12-20
| | | | | | | This "can't" happen, but it's not unreasonable to have a default return value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add fast-timer API. Use for quadrature and button driversKeith Packard2013-06-09
| | | | | | | This splits the fast-timer portion out of the debounce helper code and shares that with the quadrature driver which now uses it directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add debounce helper. Use in button and quadrature drivers for TeleLCOKeith Packard2013-06-09
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Here's the button driver and event queue logicKeith Packard2012-08-18
These were neglected in the commit which was supposed to include them Signed-off-by: Keith Packard <keithp@keithp.com>