Skip to content

Commit

Permalink
Fix problem with examples/utils println macros (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin authored Aug 25, 2024
1 parent 9b56f0f commit b22d89c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/utils/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ cfg_if::cfg_if! {

#[allow(unused_macros)]
macro_rules! println {
($($tt:tt)*) => {
log::info!($($tt,)*);
($($arg:tt)+) => {
log::info!($($arg)+);
};
}

Expand Down Expand Up @@ -90,8 +90,11 @@ cfg_if::cfg_if! {

#[allow(unused_macros)]
macro_rules! println {
($($tt:tt)*) => {
cortex_m_semihosting::hprintln!($($tt,)*).unwrap();
($s:expr) => {
cortex_m_semihosting::hprintln!($s).unwrap();
};
($s:expr, $($tt:tt)*) => {
cortex_m_semihosting::hprintln!($s, $($tt)*).unwrap();
};
}

Expand Down

0 comments on commit b22d89c

Please sign in to comment.