Files
embedded-rs/examples/hello.rs
2018-09-08 22:36:55 +02:00

25 lines
396 B
Rust

//! Prints "Hello, world!" on the OpenOCD console using semihosting
//!
//! ---
#![no_main]
#![no_std]
#[macro_use]
extern crate cortex_m_rt;
extern crate cortex_m_semihosting as sh;
extern crate panic_semihosting;
use core::fmt::Write;
use sh::hio;
entry!(main);
fn main() -> ! {
let mut stdout = hio::hstdout().unwrap();
writeln!(stdout, "Hello, world!").unwrap();
loop {}
}