Macro rp6::print

source ·
macro_rules! print {
    ($($writable: expr $(=> $format: tt)?),* $(,)?) => { ... };
    (@write $writable: expr => dec) => { ... };
    (@write $writable: expr => hex) => { ... };
    (@write $writable: expr) => { ... };
}
Expand description

Convenience macro that allows to write multiple (formatted) Serial::write statements as a single call. Currently supported formatters are dec and hex for numbers.

Example:

let mut counter = 0;
loop {
    println!(
        "Counter:",
        counter => dec,
        "(DEC) | ",
        counter => hex,
        "(HEX)"
    );
    counter += 1;
}