Skip to content

Commit ea2f0df

Browse files
committed
Kinetis HAL: Remove clock initialization code from serial and ticker HAL drivers
after updates to the mbed startup code Signed-off-by: Mahadevan Mahesh <[email protected]>
1 parent 9fce16d commit ea2f0df

File tree

14 files changed

+2
-53
lines changed

14 files changed

+2
-53
lines changed

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K22F/serial_api.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4747
obj->index = pinmap_merge(uart_tx, uart_rx);
4848
MBED_ASSERT((int)obj->index != NC);
4949

50-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
51-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
52-
BOARD_BootClockRUN();
53-
5450
uart_config_t config;
5551

5652
UART_GetDefaultConfig(&config);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K22F/us_ticker.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void us_ticker_init(void) {
2626
return;
2727
}
2828
us_ticker_inited = 1;
29-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
30-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
31-
BOARD_BootClockRUN();
3229
//Common for ticker/timer
3330
uint32_t busClock;
3431
// Structure to initialize PIT

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K66F/serial_api.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4747
obj->index = pinmap_merge(uart_tx, uart_rx);
4848
MBED_ASSERT((int)obj->index != NC);
4949

50-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
51-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
52-
BOARD_BootClockRUN();
53-
5450
uart_config_t config;
5551

5652
UART_GetDefaultConfig(&config);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K66F/us_ticker.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void us_ticker_init(void) {
2626
return;
2727
}
2828
us_ticker_inited = 1;
29-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
30-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
31-
BOARD_BootClockRUN();
3229
//Common for ticker/timer
3330
uint32_t busClock;
3431
// Structure to initialize PIT

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/serial_api.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4646
obj->index = pinmap_merge(uart_tx, uart_rx);
4747
MBED_ASSERT((int)obj->index != NC);
4848

49-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
50-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
51-
BOARD_BootClockRUN();
52-
5349
/* Set the LPUART clock source */
5450
if (obj->index == LPUART_0) {
5551
CLOCK_SetLpuart0Clock(1U);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/us_ticker.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ void us_ticker_init(void) {
2828
}
2929
us_ticker_inited = 1;
3030

31-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
32-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
33-
BOARD_BootClockRUN();
34-
3531
//Timer uses PIT
3632
//Common for ticker/timer
3733
uint32_t busClock;

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL43Z/serial_api.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4646
obj->index = pinmap_merge(uart_tx, uart_rx);
4747
MBED_ASSERT((int)obj->index != NC);
4848

49-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
50-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
51-
BOARD_BootClockRUN();
52-
5349
/* Set the LPUART clock source */
5450
if (obj->index == LPUART_0) {
5551
CLOCK_SetLpuart0Clock(1U);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL43Z/us_ticker.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ void us_ticker_init(void) {
2828
}
2929
us_ticker_inited = 1;
3030

31-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
32-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
33-
BOARD_BootClockRUN();
34-
3531
//Timer uses PIT
3632
//Common for ticker/timer
3733
uint32_t busClock;

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL82Z/serial_api.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4646
obj->index = pinmap_merge(uart_tx, uart_rx);
4747
MBED_ASSERT((int)obj->index != NC);
4848

49-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
50-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
51-
BOARD_BootClockRUN();
52-
5349
/* Set the LPUART clock source */
5450
CLOCK_SetLpuartClock(2U);
5551

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL82Z/us_ticker.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void us_ticker_init(void) {
2626
return;
2727
}
2828
us_ticker_inited = 1;
29-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
30-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
31-
BOARD_BootClockRUN();
3229
//Common for ticker/timer
3330
uint32_t busClock;
3431
// Structure to initialize PIT

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KW24D/serial_api.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4747
obj->index = pinmap_merge(uart_tx, uart_rx);
4848
MBED_ASSERT((int)obj->index != NC);
4949

50-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
51-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
52-
BOARD_BootClockRUN();
53-
5450
uart_config_t config;
5551

5652
UART_GetDefaultConfig(&config);
@@ -99,7 +95,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
9995
if (parity == ParityOdd) {
10096
temp |= UART_C1_PT_MASK;
10197
} else if (parity == ParityEven) {
102-
// PT=0 so nothing more to do
98+
// PT=0 so nothing more to do
10399
} else {
104100
// Hardware does not support forced parity
105101
MBED_ASSERT(0);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KW24D/us_ticker.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void us_ticker_init(void) {
2626
return;
2727
}
2828
us_ticker_inited = 1;
29-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
30-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
31-
BOARD_BootClockRUN();
3229
//Common for ticker/timer
3330
uint32_t busClock;
3431
// Structure to initialize PIT

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_MCU_K64F/serial_api.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
4747
obj->index = pinmap_merge(uart_tx, uart_rx);
4848
MBED_ASSERT((int)obj->index != NC);
4949

50-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
51-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
52-
BOARD_BootClockRUN();
53-
5450
uart_config_t config;
5551

5652
UART_GetDefaultConfig(&config);
@@ -99,7 +95,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
9995
if (parity == ParityOdd) {
10096
temp |= UART_C1_PT_MASK;
10197
} else if (parity == ParityEven) {
102-
// PT=0 so nothing more to do
98+
// PT=0 so nothing more to do
10399
} else {
104100
// Hardware does not support forced parity
105101
MBED_ASSERT(0);

targets/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_MCU_K64F/us_ticker.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void us_ticker_init(void) {
2626
return;
2727
}
2828
us_ticker_inited = 1;
29-
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
30-
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
31-
BOARD_BootClockRUN();
3229
//Common for ticker/timer
3330
uint32_t busClock;
3431
// Structure to initialize PIT

0 commit comments

Comments
 (0)