aboutsummaryrefslogtreecommitdiff
path: root/examples/message.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/message.rs')
-rw-r--r--examples/message.rs18
1 files changed, 4 insertions, 14 deletions
diff --git a/examples/message.rs b/examples/message.rs
index 1ff08b22..b5d68a60 100644
--- a/examples/message.rs
+++ b/examples/message.rs
@@ -7,19 +7,9 @@
extern crate panic_semihosting;
-use cortex_m_semihosting::debug;
+use cortex_m_semihosting::{debug, hprintln};
use rtfm::app;
-macro_rules! println {
- ($($tt:tt)*) => {
- if let Ok(mut stdout) = cortex_m_semihosting::hio::hstdout() {
- use core::fmt::Write;
-
- writeln!(stdout, $($tt)*).ok();
- }
- };
-}
-
#[app(device = lm3s6965)]
const APP: () = {
#[init(spawn = [foo])]
@@ -31,7 +21,7 @@ const APP: () = {
fn foo() {
static mut COUNT: u32 = 0;
- println!("foo");
+ hprintln!("foo").unwrap();
spawn.bar(*COUNT).unwrap();
*COUNT += 1;
@@ -39,14 +29,14 @@ const APP: () = {
#[task(spawn = [baz])]
fn bar(x: u32) {
- println!("bar({})", x);
+ hprintln!("bar({})", x).unwrap();
spawn.baz(x + 1, x + 2).unwrap();
}
#[task(spawn = [foo])]
fn baz(x: u32, y: u32) {
- println!("baz({}, {})", x, y);
+ hprintln!("baz({}, {})", x, y).unwrap();
if x + y > 4 {
debug::exit(debug::EXIT_SUCCESS);