STM32 LPTICKER (LPTIM): correct init execution after bootloader

pull/9798/head
jeromecoutant 2019-02-21 16:25:20 +01:00
parent f61dee1626
commit 0d620fe720
1 changed files with 4 additions and 1 deletions

View File

@ -59,16 +59,19 @@ const ticker_info_t *lp_ticker_get_info()
volatile uint8_t lp_Fired = 0;
static int LPTICKER_inited = 0;
static void LPTIM1_IRQHandler(void);
static void (*irq_handler)(void);
void lp_ticker_init(void)
{
/* Check if LPTIM is already configured */
if (__HAL_RCC_LPTIM1_IS_CLK_ENABLED()) {
if (LPTICKER_inited) {
lp_ticker_disable_interrupt();
return;
}
LPTICKER_inited = 1;
RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct = {0};
RCC_OscInitTypeDef RCC_OscInitStruct = {0};