From 09c9f64b8e0bf12cccc0474fb689c313d2b58ff3 Mon Sep 17 00:00:00 2001 From: Bing Wen Date: Wed, 27 Nov 2024 17:44:03 +0800 Subject: [PATCH] Add missing clock check --- embassy-stm32/src/rcc/g4.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-stm32/src/rcc/g4.rs b/embassy-stm32/src/rcc/g4.rs index e09b2915e5..6b34aa3060 100644 --- a/embassy-stm32/src/rcc/g4.rs +++ b/embassy-stm32/src/rcc/g4.rs @@ -237,6 +237,7 @@ pub(crate) unsafe fn init(config: Config) { let (pclk1, pclk1_tim) = super::util::calc_pclk(hclk, config.apb1_pre); let (pclk2, pclk2_tim) = super::util::calc_pclk(hclk, config.apb2_pre); + rcc_assert!(max::PCLK.contains(&pclk1)); rcc_assert!(max::PCLK.contains(&pclk2)); // Configure Core Boost mode ([RM0440] p234 – inverted because setting r1mode to 0 enables boost mode!)