Skip to content

Commit

Permalink
fix(fw): enable SYSCFG clock before using EXTI (#5020)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic authored May 25, 2024
1 parent 390c71c commit b8a0038
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions radio/src/targets/common/arm/stm32/rotary_encoder_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ void rotaryEncoderInit()
ROTARY_ENCODER_TIMER->CR1 = 0;
ROTARY_ENCODER_TIMER->DIER |= TIM_DIER_UIE;

#if defined(LL_APB4_GRP1_PERIPH_SYSCFG)
LL_APB4_GRP1_EnableClock(LL_APB4_GRP1_PERIPH_SYSCFG);
#elif defined(LL_APB2_GRP1_PERIPH_SYSCFG)
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
#else
#error "Unsupported SYSCFG clock"
#endif

LL_SYSCFG_SetEXTISource(ROTARY_ENCODER_EXTI_PORT, ROTARY_ENCODER_EXTI_SYS_LINE1);
LL_SYSCFG_SetEXTISource(ROTARY_ENCODER_EXTI_PORT, ROTARY_ENCODER_EXTI_SYS_LINE2);

Expand Down

0 comments on commit b8a0038

Please sign in to comment.