Skip to content

Commit b22d89c

Browse files
authored
Fix problem with examples/utils println macros (#134)
1 parent 9b56f0f commit b22d89c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/utils/logger.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ cfg_if::cfg_if! {
4141

4242
#[allow(unused_macros)]
4343
macro_rules! println {
44-
($($tt:tt)*) => {
45-
log::info!($($tt,)*);
44+
($($arg:tt)+) => {
45+
log::info!($($arg)+);
4646
};
4747
}
4848

@@ -90,8 +90,11 @@ cfg_if::cfg_if! {
9090

9191
#[allow(unused_macros)]
9292
macro_rules! println {
93-
($($tt:tt)*) => {
94-
cortex_m_semihosting::hprintln!($($tt,)*).unwrap();
93+
($s:expr) => {
94+
cortex_m_semihosting::hprintln!($s).unwrap();
95+
};
96+
($s:expr, $($tt:tt)*) => {
97+
cortex_m_semihosting::hprintln!($s, $($tt)*).unwrap();
9598
};
9699
}
97100

0 commit comments

Comments
 (0)