1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25



#[macro_export]
#[cfg(debug_assertions)]
#[cfg(test)]
macro_rules! debug_println {
    ($s:expr, $($tt:tt)*) => ({ })
}

#[macro_export]
#[cfg(debug_assertions)]
#[cfg(not(test))]
macro_rules! debug_println {
    ($($arg:tt)*) => ({
        use cortex_m_semihosting::hprintln;
        hprintln!($($arg)*).unwrap();
    });
}

#[macro_export]
#[cfg(not(debug_assertions))]
macro_rules! debug_println {
    ($s:expr, $($tt:tt)*) => ({  })
}