Update gpio_api.c

Modified gpio_set() to allow PIO0_0, PIO0_10, and PIO0_15 to be properly configured for GPIO.
pull/321/head
Neil Thiessen 2014-05-22 15:58:01 -06:00
parent 1073702cd2
commit 0438beba09
1 changed files with 6 additions and 1 deletions

View File

@ -26,10 +26,15 @@ static void gpio_enable(void) {
}
uint32_t gpio_set(PinName pin) {
if (!gpio_enabled)
gpio_enable();
int f = ((pin == P0_0) ||
(pin == P0_10) ||
(pin == P0_15)) ? (1) : (0);
pin_function(pin, f);
return (1UL << ((int)pin >> PIN_SHIFT & 0x1F));
}