From b3f9f3e286a2e7e4bc9399836aa663c7108eb348 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Mon, 14 Mar 2022 21:46:32 -0400 Subject: [PATCH] Timers use the clock speed apb1_tim and apb2_tim --- stm32data/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stm32data/__main__.py b/stm32data/__main__.py index d2b3ab2..b70ff45 100755 --- a/stm32data/__main__.py +++ b/stm32data/__main__.py @@ -1188,8 +1188,10 @@ def parse_rcc_regs(): if field['name'].endswith('EN'): peri = removesuffix(field['name'], 'EN') + # Timers are a bit special, they may have a x2 freq + peri_clock = f'{clock}_TIM' if re.match('^TIM\d+$', peri) else clock res = { - 'clock': clock, + 'clock': peri_clock, 'enable': { 'register': reg, 'field': field['name'],