From 1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 5 Jul 2016 18:03:49 +0200 Subject: Switch from GPLv2 to GPLv2+ Signed-off-by: Keith Packard --- src/drivers/ao_button.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/ao_button.c') diff --git a/src/drivers/ao_button.c b/src/drivers/ao_button.c index 8e7dead7..1be788a0 100644 --- a/src/drivers/ao_button.c +++ b/src/drivers/ao_button.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit v1.2.3 From be84201495fa3cabd699012e57e797355e2bd792 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 Jul 2016 21:28:34 -0700 Subject: 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 --- src/drivers/ao_button.c | 6 ++++++ src/drivers/ao_button.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src/drivers/ao_button.c') 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) { diff --git a/src/drivers/ao_button.h b/src/drivers/ao_button.h index fe5b590e..601472f9 100644 --- a/src/drivers/ao_button.h +++ b/src/drivers/ao_button.h @@ -19,6 +19,9 @@ #ifndef _AO_BUTTON_H_ #define _AO_BUTTON_H_ +uint8_t +ao_button_get(uint8_t b); + void ao_button_init(void); -- cgit v1.2.3