Skip to content

Commit 4732796

Browse files
committed
PWM channels definition update, serial uses external global variable system clock
1 parent ffac7e6 commit 4732796

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_K20D5M/pwmout_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ static const PinMap PinMap_PWM[] = {
3333
{D10, PWM_2 , 4}, // PTC2, FTM0 CH1
3434

3535
{PTA0, PWM_6 , 3}, // PTA0, FTM0 CH5
36-
{PTA3, PWM_0 , 3}, // PTA3, FTM0 CH0
37-
{PTA4, PWM_1 , 3}, // PTA4, FTM0 CH1
36+
{PTA3, PWM_1 , 3}, // PTA3, FTM0 CH0
37+
{PTA4, PWM_2 , 3}, // PTA4, FTM0 CH1
3838
{PTA5, PWM_3 , 3}, // PTA5, FTM0 CH2
3939
{PTA12, PWM_9 , 3}, // PTA12, FTM1 CH0
4040
{PTA13, PWM_10, 3}, // PTA13, FTM1 CH1
4141
{PTB0, PWM_9 , 3}, // PTB0, FTM1 CH0
4242
{PTB1, PWM_10, 3}, // PTB1, FTM1 CH1
43-
{PTC1, PWM_0 , 4}, // PTC1, FTM0 CH0
43+
{PTC1, PWM_1 , 4}, // PTC1, FTM0 CH0
4444
{PTD4, PWM_4 , 4}, // PTD4, FTM0 CH3
4545
{PTD6, PWM_7 , 4}, // PTD6, FTM0 CH6
4646
{PTD7, PWM_8 , 4}, // PTD7, FTM0 CH7

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_K20D5M/serial_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ void serial_baud(serial_t *obj, int baudrate) {
9898
// Disable UART before changing registers
9999
obj->uart->C2 &= ~(UART_C2_RE_MASK | UART_C2_TE_MASK);
100100

101-
// [TODO] not hardcode this value
102-
uint32_t PCLK = (obj->uart == UART0) ? 48000000u : 24000000u;
101+
uint32_t PCLK = (obj->uart == UART0) ? SystemCoreClock : SystemCoreClock/2;
103102

104103
// First we check to see if the basic divide with no DivAddVal/MulVal
105104
// ratio gives us an integer result. If it does, we set DivAddVal = 0,

0 commit comments

Comments
 (0)