drivers: timer: stm32_lptim: Initialize static global variable
In some configurations, a udf instruction may be generated when compiling code where static global variable lptim_clock_freq is used as a divisor. To avoid this, initialize variable on declaration so that compiler could see that it can't be used uninitialized in this division. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
dc15c03b96
commit
d62450886b
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ static const struct device *const clk_ctrl = DEVICE_DT_GET(STM32_CLOCK_CONTROL_N
|
|||
* - with prescaler of 1, the max timeout (lptim_time_base) is 2seconds
|
||||
*/
|
||||
|
||||
static uint32_t lptim_clock_freq;
|
||||
static uint32_t lptim_clock_freq = 32000;
|
||||
static int32_t lptim_time_base;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue