Verified Commit e882db08 authored by Kloenk's avatar Kloenk
Browse files

add print! and println! macro to write to UART

parent d8468cc5
Pipeline #3294 failed with stage
in 60 minutes and 14 seconds
......@@ -11,3 +11,20 @@ impl Write for Uart {
Ok(())
}
}
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::uart::_print(format_args!($($arg)*)));
}
#[macro_export]
macro_rules! println {
() => ($crate::print!("\r"));
($($arg:tt)*) => ($crate::print!("{}\r", format_args!($($arg)*)));
}
#[doc(hidden)]
pub fn _print(args: core::fmt::Arguments) {
use core::fmt::Write;
crate::UART.write_fmt(args);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment