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:
Erwan Gouriou 2022-09-07 15:07:55 +02:00 committed by Fabio Baltieri
commit d62450886b

View file

@ -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;