aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-25 13:15:07 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-25 13:15:07 -0500
commit262e01aa1f5944544df040105e764e62a7864883 (patch)
treebadbdddf69b274ae03d908e2fe6e6ef3f47e6c55 /wirish
parent4e493c670aaabd8179976621d4b0bf3997fdc814 (diff)
downloadlibrambutan-262e01aa1f5944544df040105e764e62a7864883.tar.gz
librambutan-262e01aa1f5944544df040105e764e62a7864883.zip
Trivial wirish_digital.c sanity check + bugfix.
Diffstat (limited to 'wirish')
-rw-r--r--wirish/wirish_digital.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wirish/wirish_digital.c b/wirish/wirish_digital.c
index 6f9906d..bb28f0a 100644
--- a/wirish/wirish_digital.c
+++ b/wirish/wirish_digital.c
@@ -105,11 +105,16 @@ void digitalWrite(uint8 pin, uint8 val) {
}
void togglePin(uint8 pin) {
+ if (pin >= NR_GPIO_PINS) {
+ return;
+ }
+
gpio_toggle_pin(PIN_MAP[pin].port, PIN_MAP[pin].pin);
}
uint8 isButtonPressed() {
if (digitalRead(BOARD_BUTTON_PIN)) {
+ delay(1);
while (digitalRead(BOARD_BUTTON_PIN))
;
return true;