stm32/rcc: print actual freqs on boot.

This commit is contained in:
Dario Nieuwenhuis 2023-01-20 16:31:04 +01:00
parent 539a8107e2
commit f604153f05
2 changed files with 4 additions and 1 deletions

View File

@ -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<Clocks> = 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);
}

View File

@ -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 {