From 3bf06dce4ab0b0e8ef2475bbf44564eeee6867ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20N=C3=B6lle?= Date: Thu, 30 Mar 2023 18:22:14 +0200 Subject: [PATCH] Skip /32 AHB prescaler --- src/rcc.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rcc.rs b/src/rcc.rs index 1a8af53..f6c7825 100755 --- a/src/rcc.rs +++ b/src/rcc.rs @@ -418,6 +418,8 @@ impl RccExt for RCC { let ahb_freq = match cfgr.ahb_pre { AHBPrescaler::NotDivided => sys_clk, + // skip /32 + pre if pre as u8 & 0b0100 > 0 => sys_clk / (1 << (pre as u8 - 6)), pre => sys_clk / (1 << (pre as u8 - 7)), };