From 80f003b2c63305cf976d00592252d59885f7e79b Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 21 Jun 2019 01:18:24 +0200 Subject: [PATCH] stdio: add print --- src/stdio.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stdio.rs b/src/stdio.rs index eca77d1..05ff4af 100644 --- a/src/stdio.rs +++ b/src/stdio.rs @@ -18,6 +18,15 @@ pub fn get_uart() -> &'static mut Uart { } } +#[macro_export] +macro_rules! print { + ($($arg:tt)*) => ({ + use core::fmt::Write; + let uart = crate::stdio::get_uart(); + write!(uart, $($arg)*); + }) +} + #[macro_export] macro_rules! println { ($($arg:tt)*) => ({