diff options
author | 2019-09-15 17:09:40 +0000 | |
---|---|---|
committer | 2019-09-15 17:09:40 +0000 | |
commit | 4ff28e9d13e845abf39c662643ae2ff5df57ec16 (patch) | |
tree | 7d9770cd357e584d85ef6ddc32bddd1a937d1020 /examples/task.rs | |
parent | fafeeb27270ef24fc3852711c6032f65aa7dbcc0 (diff) | |
parent | 7aa270cb92180abfc9102a69efdde378c3396b5e (diff) | |
download | rtic-4ff28e9d13e845abf39c662643ae2ff5df57ec16.tar.gz rtic-4ff28e9d13e845abf39c662643ae2ff5df57ec16.tar.zst rtic-4ff28e9d13e845abf39c662643ae2ff5df57ec16.zip |
Merge pull request #205 from japaric/heterogeneous
rtfm-syntax refactor + heterogeneous multi-core support
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] |