[LPC11U68] Fix GPIO init for specific pins

* Add GPIO initialization value for P0_12, P0_13 and P0_14 since default
mode for them are other than GPIO
* This issue reported here:
https://developer.mbed.org/questions/4874/Using-SPI-on-LPCXpresso11U68/
pull/679/head
Toyomasa Watarai 2014-11-10 14:01:59 +09:00
parent aab52cb7ec
commit b0a7a246c1
1 changed files with 7 additions and 4 deletions

View File

@ -31,11 +31,14 @@ uint32_t gpio_set(PinName pin) {
if (!gpio_enabled)
gpio_enable();
int f = ((pin == P0_0) ||
(pin == P0_10) ||
(pin == P0_15)) ? (1) : (0);
int func = ((pin == P0_0) || // reset
(pin == P0_10) || // SWCLK
(pin == P0_12) || // TMS
(pin == P0_13) || // TDO
(pin == P0_14) || // TRST
(pin == P0_15)) ? (1) : (0); // SWDIO
pin_function(pin, f);
pin_function(pin, func);
return (1UL << ((int)pin >> PIN_SHIFT & 0x1F));
}