summaryrefslogtreecommitdiff
path: root/src/common/button.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/button.h')
-rw-r--r--src/common/button.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/button.h b/src/common/button.h
index 1145a69..f7c1238 100644
--- a/src/common/button.h
+++ b/src/common/button.h
@@ -23,6 +23,7 @@
* Web: http://ni.fr.eu.org/
* Email: <nico at ni.fr.eu.org>
* }}} */
+#include "io.h"
/** Button port. */
#define BUTTON_IO B, 1
@@ -36,7 +37,10 @@ void
button_wait (void);
/** Return true if button is currently pressed. */
-uint8_t
-button_pressed (void);
+static inline uint8_t
+button_pressed (void)
+{
+ return !IO_GET (BUTTON_IO);
+}
#endif /* button_h */