Skip to content

Instantly share code, notes, and snippets.

@mvirkkunen
Created August 23, 2019 13:04
Show Gist options
  • Save mvirkkunen/eb03059c017a94e9420af8ef31629584 to your computer and use it in GitHub Desktop.
Save mvirkkunen/eb03059c017a94e9420af8ef31629584 to your computer and use it in GitHub Desktop.
#[macro_export]
macro_rules! println {
($($arg:tt)*) => {
cortex_m::interrupt::free(|_| {
let itm = unsafe { &mut *cortex_m::peripheral::ITM::ptr() };
cortex_m::iprintln!(&mut itm.stim[0], $($arg)*);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment