summaryrefslogtreecommitdiff
path: root/src/common/button.c
diff options
context:
space:
mode:
authorNicolas Schodet2011-06-17 00:45:31 +0200
committerNicolas Schodet2011-09-26 19:41:34 +0200
commit38b4a4d5ca0f30a5e058de2a99436df187a46f52 (patch)
tree08fed49b2bbac63fea0d40940e15e27182ce6b5d /src/common/button.c
parentca0e7d4a5b7e0d2ae98580fd2dd17fb82fc43d1d (diff)
src/common: remove pull up when button is pressed
Diffstat (limited to 'src/common/button.c')
-rw-r--r--src/common/button.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/button.c b/src/common/button.c
index 8d1a49b..1924f62 100644
--- a/src/common/button.c
+++ b/src/common/button.c
@@ -25,9 +25,7 @@
#include "modules/utils/utils.h"
#include "io.h"
#include "button.h"
-
-/** Button port. */
-#define BUTTON_IO B, 1
+#include "led.h"
/** Delay for the button to be considered debounced. */
#define BUTTON_DEBOUNCE_MS 100
@@ -44,6 +42,8 @@ button_wait (void)
/* Wait until button is pressed. */
while (IO_GET (BUTTON_IO))
;
+ /* Remove pull-up to save battery and shut off leds. */
+ led_no_pull_up ();
/* Wait until button is really released. */
uint8_t debounce_ms = 0;
while (debounce_ms < BUTTON_DEBOUNCE_MS)