diff options
| author | Bing Wen <[email protected]> | 2024-11-27 12:23:13 +0800 |
|---|---|---|
| committer | Bing Wen <[email protected]> | 2024-11-27 12:23:13 +0800 |
| commit | 52ab015facf9f5039f89cd772d0f178ec70d878b (patch) | |
| tree | d68ee2740a9e649c54826b123aef430d3023f51a /embassy-stm32/src/fmt.rs | |
| parent | 8eaa3c8fd3385d50bbf844c6fff0790884ac56af (diff) | |
Add new
Diffstat (limited to 'embassy-stm32/src/fmt.rs')
| -rw-r--r-- | embassy-stm32/src/fmt.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/embassy-stm32/src/fmt.rs b/embassy-stm32/src/fmt.rs index 8ca61bc39..660407569 100644 --- a/embassy-stm32/src/fmt.rs +++ b/embassy-stm32/src/fmt.rs | |||
| @@ -7,6 +7,25 @@ use core::fmt::{Debug, Display, LowerHex}; | |||
| 7 | compile_error!("You may not enable both `defmt` and `log` features."); | 7 | compile_error!("You may not enable both `defmt` and `log` features."); |
| 8 | 8 | ||
| 9 | #[collapse_debuginfo(yes)] | 9 | #[collapse_debuginfo(yes)] |
| 10 | macro_rules! rcc_assert { | ||
| 11 | ($($x:tt)*) => { | ||
| 12 | { | ||
| 13 | if cfg!(feature = "unchecked-overclocking") { | ||
| 14 | #[cfg(not(feature = "defmt"))] | ||
| 15 | ::core::assert!($($x)*); | ||
| 16 | #[cfg(feature = "defmt")] | ||
| 17 | ::defmt::assert!($($x)*); | ||
| 18 | } else { | ||
| 19 | #[cfg(feature = "log")] | ||
| 20 | ::log::warn!("`rcc_assert!` skipped: `unchecked-overclocking` feature is enabled."); | ||
| 21 | #[cfg(feature = "defmt")] | ||
| 22 | ::defmt::warn!("`rcc_assert!` skipped: `unchecked-overclocking` feature is enabled."); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | |||
| 28 | #[collapse_debuginfo(yes)] | ||
| 10 | macro_rules! assert { | 29 | macro_rules! assert { |
| 11 | ($($x:tt)*) => { | 30 | ($($x:tt)*) => { |
| 12 | { | 31 | { |
