diff options
Diffstat (limited to 'examples/task.rs')
-rw-r--r-- | examples/task.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/task.rs b/examples/task.rs index 5bb32acb..9e563d71 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -5,9 +5,8 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_semihosting::{debug, hprintln}; +use panic_semihosting as _; #[rtfm::app(device = lm3s6965)] const APP: () = { @@ -18,16 +17,20 @@ const APP: () = { #[task(spawn = [bar, baz])] fn foo(c: foo::Context) { - hprintln!("foo").unwrap(); + hprintln!("foo - start").unwrap(); // spawns `bar` onto the task scheduler // `foo` and `bar` have the same priority so `bar` will not run until // after `foo` terminates c.spawn.bar().unwrap(); + hprintln!("foo - middle").unwrap(); + // spawns `baz` onto the task scheduler // `baz` has higher priority than `foo` so it immediately preempts `foo` c.spawn.baz().unwrap(); + + hprintln!("foo - end").unwrap(); } #[task] |