diff --git a/embassy-stm32/src/fmt.rs b/embassy-stm32/src/fmt.rs index 660407569..b6ae24ee8 100644 --- a/embassy-stm32/src/fmt.rs +++ b/embassy-stm32/src/fmt.rs @@ -10,12 +10,15 @@ compile_error!("You may not enable both `defmt` and `log` features."); macro_rules! rcc_assert { ($($x:tt)*) => { { - if cfg!(feature = "unchecked-overclocking") { + #[cfg(not(feature = "unchecked-overclocking"))] + { #[cfg(not(feature = "defmt"))] ::core::assert!($($x)*); #[cfg(feature = "defmt")] ::defmt::assert!($($x)*); - } else { + } + #[cfg(feature = "unchecked-overclocking")] + { #[cfg(feature = "log")] ::log::warn!("`rcc_assert!` skipped: `unchecked-overclocking` feature is enabled."); #[cfg(feature = "defmt")]