diff options
author | 2023-01-07 17:59:39 +0100 | |
---|---|---|
committer | 2023-03-01 00:33:24 +0100 | |
commit | 9a4f97ca5ebf19e6612115db5c763d0d61dd28a1 (patch) | |
tree | 1f37d247f715ad3d5215aa7de3aa6d4eb94a7027 /examples/only-shared-access.rs | |
parent | 5606ba3cf38c80be5d3e9c88ad4da9982b114851 (diff) | |
download | rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.gz rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.zst rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.zip |
more examples
Diffstat (limited to 'examples/only-shared-access.rs')
-rw-r--r-- | examples/only-shared-access.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/only-shared-access.rs b/examples/only-shared-access.rs index 8b0a77ef..b506e441 100644 --- a/examples/only-shared-access.rs +++ b/examples/only-shared-access.rs @@ -4,6 +4,7 @@ #![deny(warnings)] #![no_main] #![no_std] +#![feature(type_alias_impl_trait)] use panic_semihosting as _; @@ -20,15 +21,15 @@ mod app { struct Local {} #[init] - fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { + fn init(_: init::Context) -> (Shared, Local) { foo::spawn().unwrap(); bar::spawn().unwrap(); - (Shared { key: 0xdeadbeef }, Local {}, init::Monotonics()) + (Shared { key: 0xdeadbeef }, Local {}) } #[task(shared = [&key])] - fn foo(cx: foo::Context) { + async fn foo(cx: foo::Context) { let key: &u32 = cx.shared.key; hprintln!("foo(key = {:#x})", key).unwrap(); @@ -36,7 +37,7 @@ mod app { } #[task(priority = 2, shared = [&key])] - fn bar(cx: bar::Context) { + async fn bar(cx: bar::Context) { hprintln!("bar(key = {:#x})", cx.shared.key).unwrap(); } } |