Merge pull request #1164 from embassy-rs/stm32-print-rcc
stm32/rcc: print actual freqs on boot.
This commit is contained in:
commit
825b67101b
@ -24,7 +24,8 @@ use crate::time::Hertz;
|
|||||||
mod _version;
|
mod _version;
|
||||||
pub use _version::*;
|
pub use _version::*;
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub struct Clocks {
|
pub struct Clocks {
|
||||||
pub sys: Hertz,
|
pub sys: Hertz,
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ static mut CLOCK_FREQS: MaybeUninit<Clocks> = MaybeUninit::uninit();
|
|||||||
///
|
///
|
||||||
/// Safety: Sets a mutable global.
|
/// Safety: Sets a mutable global.
|
||||||
pub(crate) unsafe fn set_freqs(freqs: Clocks) {
|
pub(crate) unsafe fn set_freqs(freqs: Clocks) {
|
||||||
|
debug!("rcc: {:?}", freqs);
|
||||||
CLOCK_FREQS.as_mut_ptr().write(freqs);
|
CLOCK_FREQS.as_mut_ptr().write(freqs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/// Hertz
|
/// Hertz
|
||||||
#[derive(PartialEq, PartialOrd, Clone, Copy, Debug, Eq)]
|
#[derive(PartialEq, PartialOrd, Clone, Copy, Debug, Eq)]
|
||||||
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub struct Hertz(pub u32);
|
pub struct Hertz(pub u32);
|
||||||
|
|
||||||
impl Hertz {
|
impl Hertz {
|
||||||
|
Loading…
Reference in New Issue
Block a user