//! Unsafe synchronous dump-string-to-uart impl and macro for debugging.

use core::fmt;
use core2::io::{Cursor, Write};

// Convenience wrapper since capsules can't use unsafe{}
pub fn send_sync(buf: &[u8], len: usize) {
    unsafe {
        crate::uart_hal::UART0.transmit_sync(&buf[..len]);
    }
}

pub fn vdprintf(args: fmt::Arguments) {
    let mut uart_buf = [0u8; 256];
    let mut cur = Cursor::new(&mut uart_buf[..]);
    if cur.write_fmt(args).is_ok() {
        let pos = cur.position();
        send_sync(&uart_buf, pos as usize);
    }
}

#[macro_export]
macro_rules! dprintf {
    ($msg:expr) => ({
        $crate::dprintf_hal::vdprintf(format_args!($msg))
    });
    ($fmt:expr, $($arg:tt)+) => ({
        $crate::dprintf_hal::vdprintf(format_args!($fmt, $($arg)+))
    });
}
