From a7b3786810ee93c81b65a431c04fd2f5d75354d2 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Mon, 19 Apr 2010 22:25:49 -0400 Subject: Added libmaple gpio_read_bit --- core/wiring_digital.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/wiring_digital.c') diff --git a/core/wiring_digital.c b/core/wiring_digital.c index 25433de..c1b7201 100644 --- a/core/wiring_digital.c +++ b/core/wiring_digital.c @@ -133,8 +133,7 @@ void pinMode(uint8 pin, WiringPinMode mode) { uint32 digitalRead(uint8 pin) { if (pin >= NR_MAPLE_PINS) return 0; - - return (PIN_MAP[pin].port->IDR & BIT(PIN_MAP[pin].pin)) ? 1 : 0; + return gpio_read_bit(PIN_MAP[pin].port, PIN_MAP[pin].pin); } void digitalWrite(uint8 pin, uint8 val) { -- cgit v1.2.3