aboutsummaryrefslogtreecommitdiff
path: root/examples/task.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-11 19:41:57 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-11 20:35:50 +0200
commit5b8e6a22ab68e316e11641dedf5b39e20878c7b7 (patch)
tree1bdc1812ca24203f3b99f381b1e9f8c89f60be24 /examples/task.rs
parent524273c96a978299b64e51a9cdcc007585a0f170 (diff)
downloadrtic-5b8e6a22ab68e316e11641dedf5b39e20878c7b7.tar.gz
rtic-5b8e6a22ab68e316e11641dedf5b39e20878c7b7.tar.zst
rtic-5b8e6a22ab68e316e11641dedf5b39e20878c7b7.zip
Fixing examples and tests, modules now import user imports correctly
Fmt Correct syntax crate UI test fix Fix build script Cleanup More cleanup
Diffstat (limited to 'examples/task.rs')
-rw-r--r--examples/task.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/task.rs b/examples/task.rs
index 80a9c431..f3d916f3 100644
--- a/examples/task.rs
+++ b/examples/task.rs
@@ -10,27 +10,27 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod app {
- #[init(spawn = [foo])]
- fn init(c: init::Context) -> init::LateResources {
- c.spawn.foo().unwrap();
+ #[init]
+ fn init(_: init::Context) -> init::LateResources {
+ foo::spawn().unwrap();
init::LateResources {}
}
- #[task(spawn = [bar, baz])]
- fn foo(c: foo::Context) {
+ #[task]
+ fn foo(_: foo::Context) {
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();
+ bar::spawn().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();
+ baz::spawn().unwrap();
hprintln!("foo - end").unwrap();
}