mirror of https://github.com/ARMmbed/mbed-os.git
[STM32] remove superfluous calls to SystemCoreClockUpdate
Supported toolchains initialization steps have been modified to make sure that mbed_sdk_initi is called _after_ RAM initialization and _before_ C++ objects creation. since this was done, there is no need to redundant SystemCoreClockUpdates in the driverspull/2917/head
parent
bcbe0b17de
commit
e8675033f4
|
@ -162,9 +162,6 @@ void pwmout_period_us(pwmout_t* obj, int us) {
|
||||||
|
|
||||||
__HAL_TIM_DISABLE(&TimHandle);
|
__HAL_TIM_DISABLE(&TimHandle);
|
||||||
|
|
||||||
// Update the SystemCoreClock variable
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
/* To make it simple, we use to possible prescaler values which lead to:
|
/* To make it simple, we use to possible prescaler values which lead to:
|
||||||
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
||||||
* or
|
* or
|
||||||
|
|
|
@ -90,10 +90,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,9 +152,6 @@ void pwmout_period_us(pwmout_t* obj, int us)
|
||||||
|
|
||||||
__HAL_TIM_DISABLE(&TimHandle);
|
__HAL_TIM_DISABLE(&TimHandle);
|
||||||
|
|
||||||
// Update the SystemCoreClock variable
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
/* To make it simple, we use to possible prescaler values which lead to:
|
/* To make it simple, we use to possible prescaler values which lead to:
|
||||||
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
||||||
* or
|
* or
|
||||||
|
|
|
@ -82,10 +82,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,10 +82,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,9 +113,6 @@ void i2c_frequency(i2c_t *obj, int hz)
|
||||||
timeout = LONG_TIMEOUT;
|
timeout = LONG_TIMEOUT;
|
||||||
while ((__HAL_I2C_GET_FLAG(&I2cHandle, I2C_FLAG_BUSY)) && (timeout-- != 0));
|
while ((__HAL_I2C_GET_FLAG(&I2cHandle, I2C_FLAG_BUSY)) && (timeout-- != 0));
|
||||||
|
|
||||||
// Update the SystemCoreClock variable.
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Values calculated with I2C_Timing_Configuration_V1.0.1.xls file (see AN4235)
|
Values calculated with I2C_Timing_Configuration_V1.0.1.xls file (see AN4235)
|
||||||
* Standard mode (up to 100 kHz)
|
* Standard mode (up to 100 kHz)
|
||||||
|
|
|
@ -82,9 +82,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
|
|
|
@ -84,10 +84,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,10 +83,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,8 +166,6 @@ void pwmout_period_us(pwmout_t* obj, int us)
|
||||||
|
|
||||||
__HAL_TIM_DISABLE(&TimHandle);
|
__HAL_TIM_DISABLE(&TimHandle);
|
||||||
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
/* To make it simple, we use to possible prescaler values which lead to:
|
/* To make it simple, we use to possible prescaler values which lead to:
|
||||||
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
||||||
* or
|
* or
|
||||||
|
|
|
@ -82,10 +82,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,8 +167,6 @@ void pwmout_period_us(pwmout_t* obj, int us)
|
||||||
|
|
||||||
__HAL_TIM_DISABLE(&TimHandle);
|
__HAL_TIM_DISABLE(&TimHandle);
|
||||||
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
/* To make it simple, we use to possible prescaler values which lead to:
|
/* To make it simple, we use to possible prescaler values which lead to:
|
||||||
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
* pwm unit = 1us, period/pulse can be from 1us to 65535us
|
||||||
* or
|
* or
|
||||||
|
|
|
@ -82,10 +82,6 @@ static void init_uart(serial_t *obj)
|
||||||
huart->Init.Mode = UART_MODE_TX_RX;
|
huart->Init.Mode = UART_MODE_TX_RX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
|
|
||||||
/* and before HAL Init. SystemCoreClock init required here */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
|
|
||||||
if (HAL_UART_Init(huart) != HAL_OK) {
|
if (HAL_UART_Init(huart) != HAL_OK) {
|
||||||
error("Cannot initialize UART\n");
|
error("Cannot initialize UART\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue