mbed library sources
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC81X/pinmap.c
- Revision:
- 614:9d86c2ae5de0
- Parent:
- 285:31249416b6f9
--- a/targets/hal/TARGET_NXP/TARGET_LPC81X/pinmap.c Thu Aug 20 10:45:13 2015 +0100 +++ b/targets/hal/TARGET_NXP/TARGET_LPC81X/pinmap.c Tue Sep 01 16:00:09 2015 +0100 @@ -27,7 +27,17 @@ }; void pin_function(PinName pin, int function) { - + if (function == 0) { + // Disable initial fixed function for P0_2, P0_3 and P0_5 + uint32_t enable = 0; + if (pin == P0_2) + enable = 1 << 3; + else if (pin == P0_3) + enable = 1 << 2; + else if (pin == P0_5) + enable = 1 << 6; + LPC_SWM->PINENABLE0 |= enable; + } } void pin_mode(PinName pin, PinMode mode) {