Content-Length: 261585 | pFad | http://github.com/micropython/micropython/commit/91386b3d56b4ef3bb27af89846c1cc2712f6065f

26 stm32/timer: Use APB2 to calculate timer 20 source frequency. · micropython/micropython@91386b3 · GitHub
Skip to content

Commit 91386b3

Browse files
H-Grobbendpgeorge
authored andcommitted
stm32/timer: Use APB2 to calculate timer 20 source frequency.
Signed-off-by: Herwin Grobben <h.grobben@aemics.nl>
1 parent 3b94889 commit 91386b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/stm32/timer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ uint32_t timer_get_source_freq(uint32_t tim_id) {
264264
#else
265265

266266
uint32_t source, clk_div;
267-
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) {
268-
// TIM{1,8,9,10,11} are on APB2
267+
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11) || tim_id == 20) {
268+
// TIM{1,8,9,10,11,20} are on APB2
269269
#if defined(STM32F0) || defined(STM32G0)
270270
source = HAL_RCC_GetPCLK1Freq();
271271
clk_div = RCC->CFGR & RCC_CFGR_PPRE;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/micropython/micropython/commit/91386b3d56b4ef3bb27af89846c1cc2712f6065f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy