use hprint macros

This commit is contained in:
Jorge Aparicio
2018-11-09 23:51:11 +01:00
parent 7e2bec66b7
commit 9c6b290e12
4 changed files with 12 additions and 34 deletions

View File

@@ -5,17 +5,15 @@
extern crate panic_halt;
use core::fmt::Write;
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hio};
use cortex_m_semihosting::{debug, hprintln};
#[entry]
fn main() -> ! {
let mut stdout = hio::hstdout().unwrap();
writeln!(stdout, "Hello, world!").unwrap();
hprintln!("Hello, world!").unwrap();
// exit QEMU or the debugger section
// exit QEMU
// NOTE do not run this on hardware; it can corrupt OpenOCD state
debug::exit(debug::EXIT_SUCCESS);
loop {}