diff options
author | Keith Packard <keithp@keithp.com> | 2016-07-27 21:28:34 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-08-02 16:55:11 -0700 |
commit | be84201495fa3cabd699012e57e797355e2bd792 (patch) | |
tree | 3d857549c57476302aa98579d7a8ad39806bd077 /src/drivers/ao_button.c | |
parent | a6701283af7ed2b3016a910d6edbe4a5e8304581 (diff) |
altos: Add 'ao_button_get' to button driver
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>
Diffstat (limited to 'src/drivers/ao_button.c')
-rw-r--r-- | src/drivers/ao_button.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/ao_button.c b/src/drivers/ao_button.c index 1be788a0..725ac45a 100644 --- a/src/drivers/ao_button.c +++ b/src/drivers/ao_button.c @@ -93,6 +93,12 @@ _ao_button_init(uint8_t b) } +uint8_t +ao_button_get(uint8_t b) +{ + return ao_button_state[b].value; +} + static void ao_button_isr(void) { |