Skip to content

Commit

Permalink
fix: peripheral clock for TIM13
Browse files Browse the repository at this point in the history
This prevented the mixer scheduler to work properly on `horus` targets, which is the only one using `TIM13`.
  • Loading branch information
raphaelcoeffic committed Nov 11, 2023
1 parent 399e550 commit 1f06a30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions radio/src/targets/common/arm/stm32/stm32_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ void stm32_timer_enable_clock(TIM_TypeDef *TIMx)
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM8);
} else if (TIMx == TIM12) {
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM12);
} else if (TIMx == TIM13) {
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM13);
} else if (TIMx == TIM14) {
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM14);
}
Expand All @@ -58,6 +60,8 @@ void stm32_timer_disable_clock(TIM_TypeDef *TIMx)
LL_APB2_GRP1_DisableClock(LL_APB2_GRP1_PERIPH_TIM8);
} else if (TIMx == TIM12) {
LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_TIM12);
} else if (TIMx == TIM13) {
LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_TIM13);
} else if (TIMx == TIM14) {
LL_APB1_GRP1_DisableClock(LL_APB1_GRP1_PERIPH_TIM14);
}
Expand All @@ -77,6 +81,12 @@ bool stm32_timer_is_clock_enabled(TIM_TypeDef *TIMx)
return LL_APB1_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM5) != 0;
} else if (TIMx == TIM8) {
return LL_APB2_GRP1_IsEnabledClock(LL_APB2_GRP1_PERIPH_TIM8) != 0;
} else if (TIMx == TIM12) {
return LL_APB2_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM12) != 0;
} else if (TIMx == TIM13) {
return LL_APB2_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM13) != 0;
} else if (TIMx == TIM14) {
return LL_APB2_GRP1_IsEnabledClock(LL_APB1_GRP1_PERIPH_TIM14) != 0;
}

// not supported
Expand Down

0 comments on commit 1f06a30

Please sign in to comment.