From b0a7a246c147df566cdd270d77d0d1cfcf6205af Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Mon, 10 Nov 2014 14:01:59 +0900 Subject: [PATCH] [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/ --- .../targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c index 97863afb3c..99ee19b2af 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_api.c @@ -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)); }