diff options
author | 2023-01-07 17:59:39 +0100 | |
---|---|---|
committer | 2023-03-01 00:33:24 +0100 | |
commit | 9a4f97ca5ebf19e6612115db5c763d0d61dd28a1 (patch) | |
tree | 1f37d247f715ad3d5215aa7de3aa6d4eb94a7027 /examples/task.rs | |
parent | 5606ba3cf38c80be5d3e9c88ad4da9982b114851 (diff) | |
download | rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.gz rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.zst rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.zip |
more examples
Diffstat (limited to 'examples/task.rs')
-rw-r--r-- | examples/task.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/task.rs b/examples/task.rs index 2c53aa23..fe1408b4 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -4,6 +4,7 @@ #![deny(warnings)] #![no_main] #![no_std] +#![feature(type_alias_impl_trait)] use panic_semihosting as _; @@ -18,14 +19,14 @@ mod app { struct Local {} #[init] - fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { + fn init(_: init::Context) -> (Shared, Local) { foo::spawn().unwrap(); - (Shared {}, Local {}, init::Monotonics()) + (Shared {}, Local {}) } #[task] - fn foo(_: foo::Context) { + async fn foo(_: foo::Context) { hprintln!("foo - start").unwrap(); // spawns `bar` onto the task scheduler @@ -43,14 +44,14 @@ mod app { } #[task] - fn bar(_: bar::Context) { + async fn bar(_: bar::Context) { hprintln!("bar").unwrap(); debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } #[task(priority = 2)] - fn baz(_: baz::Context) { + async fn baz(_: baz::Context) { hprintln!("baz").unwrap(); } } |