From 9fcc2076293971299788d71b353c58665da26161 Mon Sep 17 00:00:00 2001 From: Greg V Date: Fri, 14 Jan 2022 20:44:03 +0300 Subject: [PATCH] stm32l1/rcc: fix clock frequency assertion It was comparing a number in Hz (!) to "32" (MHz). embassy-stm32's units don't work like those used by stm32-hal :/ --- embassy-stm32/src/rcc/l1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embassy-stm32/src/rcc/l1.rs b/embassy-stm32/src/rcc/l1.rs index e6518444b..904e6ab5d 100644 --- a/embassy-stm32/src/rcc/l1.rs +++ b/embassy-stm32/src/rcc/l1.rs @@ -258,7 +258,7 @@ pub(crate) unsafe fn init(config: Config) { PLLDiv::Div3 => freq / 3, PLLDiv::Div4 => freq / 4, }; - assert!(freq <= 32_u32.mhz().0); + assert!(freq <= 32_000_000); RCC.cfgr().write(move |w| { w.set_pllmul(mul.into());