diff options
author | 2019-08-21 10:17:27 +0200 | |
---|---|---|
committer | 2019-08-21 10:17:27 +0200 | |
commit | 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 (patch) | |
tree | dba2a8e8316e8cd868ccb7b46a80d63c5f61a224 /examples/task.rs | |
parent | 0e146f8d1142672725b6abb38478f503a9261c80 (diff) | |
download | rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.gz rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.zst rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.zip |
doc up
Diffstat (limited to 'examples/task.rs')
-rw-r--r-- | examples/task.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/task.rs b/examples/task.rs index 43f7e569..9e563d71 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -17,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] |