Merge pull request #1164 from embassy-rs/stm32-print-rcc
stm32/rcc: print actual freqs on boot.
This commit is contained in:
		| @@ -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); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user