aboutsummaryrefslogtreecommitdiff
path: root/examples/static.rs
diff options
context:
space:
mode:
authorGravatar Per Lindgren <per.lindgren@ltu.se> 2023-01-07 17:59:39 +0100
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2023-03-01 00:33:24 +0100
commit9a4f97ca5ebf19e6612115db5c763d0d61dd28a1 (patch)
tree1f37d247f715ad3d5215aa7de3aa6d4eb94a7027 /examples/static.rs
parent5606ba3cf38c80be5d3e9c88ad4da9982b114851 (diff)
downloadrtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.gz
rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.tar.zst
rtic-9a4f97ca5ebf19e6612115db5c763d0d61dd28a1.zip
more examples
Diffstat (limited to 'examples/static.rs')
-rw-r--r--examples/static.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/static.rs b/examples/static.rs
index c9aa6046..9c981db3 100644
--- a/examples/static.rs
+++ b/examples/static.rs
@@ -4,6 +4,7 @@
#![deny(warnings)]
#![no_main]
#![no_std]
+#![feature(type_alias_impl_trait)]
use panic_semihosting as _;
@@ -22,14 +23,14 @@ mod app {
}
#[init(local = [q: Queue<u32, 5> = Queue::new()])]
- fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
+ fn init(cx: init::Context) -> (Shared, Local) {
// q has 'static life-time so after the split and return of `init`
// it will continue to exist and be allocated
let (p, c) = cx.local.q.split();
foo::spawn().unwrap();
- (Shared {}, Local { p, c }, init::Monotonics())
+ (Shared {}, Local { p, c })
}
#[idle(local = [c])]
@@ -50,7 +51,7 @@ mod app {
}
#[task(local = [p, state: u32 = 0])]
- fn foo(c: foo::Context) {
+ async fn foo(c: foo::Context) {
*c.local.state += 1;
// Lock-free access to the same underlying queue!