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
26
27
28
29
//! Collection of macros.

/// Macro for printing through ITM.
#[macro_export]
macro_rules! print {
  ($str:expr) => {
    $crate::itm::write_str($str);
  };

  ($($arg:tt)*) => {
    $crate::itm::write_fmt(format_args!($($arg)*));
  };
}

/// Macro for printing through ITM, with a newline.
#[macro_export]
macro_rules! println {
  () => {
    print!("\n");
  };

  ($fmt:expr) => {
    print!(concat!($fmt, "\n"));
  };

  ($fmt:expr, $($arg:tt)*) => {
    print!(concat!($fmt, "\n"), $($arg)*);
  };
}