mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c
- Revision:
- 117:e0a7df0a9a56
- Parent:
- 112:a7168c414ef2
- Child:
- 227:7bd0639b8911
--- a/targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c Tue Mar 11 17:15:06 2014 +0000 +++ b/targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c Wed Mar 12 10:30:07 2014 +0000 @@ -30,8 +30,7 @@ static unsigned char sct_used = 0; static int get_available_sct(void) { int i; - // start from 1, since 0 is used by ticker at the moment - for (i=1; i<4; i++) { + for (i=0; i<4; i++) { if ((sct_used & (1 << i)) == 0) return i; } @@ -61,6 +60,11 @@ LPC_SYSCON->PRESETCTRL1 &= ~(1 << (obj->pwm_ch + 2)); switch(obj->pwm_ch) { + case 0: + // SCT0_OUT0 + LPC_SWM->PINASSIGN[7] &= ~0x0000FF00; + LPC_SWM->PINASSIGN[7] |= (pin << 8); + break; case 1: // SCT1_OUT0 LPC_SWM->PINASSIGN[8] &= ~0x000000FF;