From f604153f05e02fb07903f45b756fc9ddb6667d8a Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 20 Jan 2023 16:31:04 +0100 Subject: [PATCH] stm32/rcc: print actual freqs on boot. --- embassy-stm32/src/rcc/mod.rs | 4 +++- embassy-stm32/src/time.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index 0a52089d..d4bd3d6b 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs @@ -24,7 +24,8 @@ use crate::time::Hertz; mod _version; pub use _version::*; -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub struct Clocks { pub sys: Hertz, @@ -72,6 +73,7 @@ static mut CLOCK_FREQS: MaybeUninit = MaybeUninit::uninit(); /// /// Safety: Sets a mutable global. pub(crate) unsafe fn set_freqs(freqs: Clocks) { + debug!("rcc: {:?}", freqs); CLOCK_FREQS.as_mut_ptr().write(freqs); } diff --git a/embassy-stm32/src/time.rs b/embassy-stm32/src/time.rs index 49140bbe..975517a4 100644 --- a/embassy-stm32/src/time.rs +++ b/embassy-stm32/src/time.rs @@ -2,6 +2,7 @@ /// Hertz #[derive(PartialEq, PartialOrd, Clone, Copy, Debug, Eq)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub struct Hertz(pub u32); impl Hertz {