move out most of text

see https://github.com/rust-embedded/book/pull/20
This commit is contained in:
Jorge Aparicio
2018-09-06 16:27:51 +02:00
parent 77a0685a17
commit 7faeedd95a
14 changed files with 126 additions and 657 deletions

View File

@@ -1,24 +1,22 @@
//! Prints "Hello, world!" on the OpenOCD console using semihosting
//!
//! ---
//! Prints "Hello, world!" on the host 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;
extern crate panic_halt;
use core::fmt::Write;
use sh::hio;
entry!(main);
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hio};
#[entry]
fn main() -> ! {
let mut stdout = hio::hstdout().unwrap();
writeln!(stdout, "Hello, world!").unwrap();
// exit QEMU or the debugger section
debug::exit(debug::EXIT_SUCCESS);
loop {}
}