From 2605dabca3996f3cff690eba121c9ef155014792 Mon Sep 17 00:00:00 2001 From: Thales Fragoso Date: Thu, 20 May 2021 23:21:22 -0300 Subject: [PATCH] H7 RCC: Fix off by one error --- embassy-stm32/src/rcc/h7/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/embassy-stm32/src/rcc/h7/mod.rs b/embassy-stm32/src/rcc/h7/mod.rs index 4f73835f..d8d231ba 100644 --- a/embassy-stm32/src/rcc/h7/mod.rs +++ b/embassy-stm32/src/rcc/h7/mod.rs @@ -83,7 +83,6 @@ impl<'d> Rcc<'d> { } } - // TODO: FLASH and PWR /// Freeze the core clocks, returning a Core Clocks Distribution /// and Reset (CCDR) structure. The actual frequency of the clocks /// configured is returned in the `clocks` member of the CCDR @@ -419,7 +418,7 @@ impl<'d> Rcc<'d> { _ => (0b111, 16), }; let real_pclk = hclk / u32::from(ppre); - assert!(real_pclk < max_pclk); + assert!(real_pclk <= max_pclk); let tim_ker_clk = if let Some(tim_pre) = tim_pre { let clk = match (bits, tim_pre) {