diff options
author | Keith Packard <keithp@keithp.com> | 2013-06-09 22:09:13 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-06-09 22:09:13 -0700 |
commit | 988924b51980ad43e39bc4785a625ff25eb16449 (patch) | |
tree | b0b3abecd78b1a3471244867cbbe9d3bbf1c7944 /src/drivers/ao_button.c | |
parent | 72b6c699d355fcd41addb9919d846e63105b9db7 (diff) |
altos: Add fast-timer API. Use for quadrature and button drivers
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>
Diffstat (limited to 'src/drivers/ao_button.c')
-rw-r--r-- | src/drivers/ao_button.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/ao_button.c b/src/drivers/ao_button.c index 7b1fb530..25c0cd5c 100644 --- a/src/drivers/ao_button.c +++ b/src/drivers/ao_button.c @@ -74,9 +74,10 @@ _ao_button_set(struct ao_debounce *debounce, uint8_t value) static void ao_button_debounce_init(struct ao_debounce *debounce) { - debounce->hold = AO_BUTTON_DEBOUNCE_HOLD; - debounce->_get = _ao_button_get; - debounce->_set = _ao_button_set; + ao_debounce_config(debounce, + _ao_button_get, + _ao_button_set, + AO_BUTTON_DEBOUNCE_HOLD); } static void |