Skip to content

Commit

Permalink
Merge pull request #3089 from NXPmicro/Remove_Clock_Init
Browse files Browse the repository at this point in the history
Kinetis HAL: Remove clock initialization code from serial and ticker …
  • Loading branch information
0xc0170 authored Oct 25, 2016
2 parents 4d1d1c5 + ea2f0df commit 26bf6eb
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

uart_config_t config;

UART_GetDefaultConfig(&config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ void us_ticker_init(void) {
return;
}
us_ticker_inited = 1;
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();
//Common for ticker/timer
uint32_t busClock;
// Structure to initialize PIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

uart_config_t config;

UART_GetDefaultConfig(&config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ void us_ticker_init(void) {
return;
}
us_ticker_inited = 1;
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();
//Common for ticker/timer
uint32_t busClock;
// Structure to initialize PIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

/* Set the LPUART clock source */
if (obj->index == LPUART_0) {
CLOCK_SetLpuart0Clock(1U);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ void us_ticker_init(void) {
}
us_ticker_inited = 1;

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

//Timer uses PIT
//Common for ticker/timer
uint32_t busClock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

/* Set the LPUART clock source */
if (obj->index == LPUART_0) {
CLOCK_SetLpuart0Clock(1U);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ void us_ticker_init(void) {
}
us_ticker_inited = 1;

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

//Timer uses PIT
//Common for ticker/timer
uint32_t busClock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

/* Set the LPUART clock source */
CLOCK_SetLpuartClock(2U);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ void us_ticker_init(void) {
return;
}
us_ticker_inited = 1;
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();
//Common for ticker/timer
uint32_t busClock;
// Structure to initialize PIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

uart_config_t config;

UART_GetDefaultConfig(&config);
Expand Down Expand Up @@ -99,7 +95,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
if (parity == ParityOdd) {
temp |= UART_C1_PT_MASK;
} else if (parity == ParityEven) {
// PT=0 so nothing more to do
// PT=0 so nothing more to do
} else {
// Hardware does not support forced parity
MBED_ASSERT(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ void us_ticker_init(void) {
return;
}
us_ticker_inited = 1;
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();
//Common for ticker/timer
uint32_t busClock;
// Structure to initialize PIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
obj->index = pinmap_merge(uart_tx, uart_rx);
MBED_ASSERT((int)obj->index != NC);

// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();

uart_config_t config;

UART_GetDefaultConfig(&config);
Expand Down Expand Up @@ -99,7 +95,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
if (parity == ParityOdd) {
temp |= UART_C1_PT_MASK;
} else if (parity == ParityEven) {
// PT=0 so nothing more to do
// PT=0 so nothing more to do
} else {
// Hardware does not support forced parity
MBED_ASSERT(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ void us_ticker_init(void) {
return;
}
us_ticker_inited = 1;
// Need to initialize the clocks here as ticker init gets called before mbed_sdk_init
if (SystemCoreClock == DEFAULT_SYSTEM_CLOCK)
BOARD_BootClockRUN();
//Common for ticker/timer
uint32_t busClock;
// Structure to initialize PIT
Expand Down

0 comments on commit 26bf6eb

Please sign in to comment.