stm32/timer: Use APB2 to calculate timer 20 source frequency.
Signed-off-by: Herwin Grobben <h.grobben@aemics.nl>
This commit is contained in:
committed by
Damien George
parent
3b948893d8
commit
91386b3d56
@@ -264,8 +264,8 @@ uint32_t timer_get_source_freq(uint32_t tim_id) {
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
uint32_t source, clk_div;
|
uint32_t source, clk_div;
|
||||||
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) {
|
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11) || tim_id == 20) {
|
||||||
// TIM{1,8,9,10,11} are on APB2
|
// TIM{1,8,9,10,11,20} are on APB2
|
||||||
#if defined(STM32F0) || defined(STM32G0)
|
#if defined(STM32F0) || defined(STM32G0)
|
||||||
source = HAL_RCC_GetPCLK1Freq();
|
source = HAL_RCC_GetPCLK1Freq();
|
||||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE;
|
clk_div = RCC->CFGR & RCC_CFGR_PPRE;
|
||||||
|
|||||||
Reference in New Issue
Block a user