Skip to content

Commit 774ee68

Browse files
jeromecoutantCruz Monrreal II
authored andcommitted
STM32 LPTICKER (LPTIM): correct init execution after bootloader
1 parent 7309bd9 commit 774ee68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,19 @@ const ticker_info_t *lp_ticker_get_info()
5959

6060
volatile uint8_t lp_Fired = 0;
6161

62+
static int LPTICKER_inited = 0;
63+
6264
static void LPTIM1_IRQHandler(void);
6365
static void (*irq_handler)(void);
6466

6567
void lp_ticker_init(void)
6668
{
6769
/* Check if LPTIM is already configured */
68-
if (__HAL_RCC_LPTIM1_IS_CLK_ENABLED()) {
70+
if (LPTICKER_inited) {
6971
lp_ticker_disable_interrupt();
7072
return;
7173
}
74+
LPTICKER_inited = 1;
7275

7376
RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct = {0};
7477
RCC_OscInitTypeDef RCC_OscInitStruct = {0};

0 commit comments

Comments
 (0)