Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 LPTICKER (LPTIM): correct init execution after bootloader #9798

Merged
merged 1 commit into from
Feb 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion targets/TARGET_STM/lp_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down