aboutsummaryrefslogtreecommitdiff
path: root/examples/not-sync.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-10 22:42:44 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-10 22:42:44 +0200
commit9195038c87703fc94b6e99f6de593886d51c2b19 (patch)
tree56855952357fe5bb689504ed8a6348dc3c1f3718 /examples/not-sync.rs
parent14d63f496118f4243f28ddf3218523aa36a80322 (diff)
downloadrtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.gz
rtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.zst
rtic-9195038c87703fc94b6e99f6de593886d51c2b19.zip
implement RFC #212
Diffstat (limited to 'examples/not-sync.rs')
-rw-r--r--examples/not-sync.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/not-sync.rs b/examples/not-sync.rs
index 6b499111..f0f6075e 100644
--- a/examples/not-sync.rs
+++ b/examples/not-sync.rs
@@ -16,21 +16,24 @@ pub struct NotSync {
#[rtfm::app(device = lm3s6965)]
const APP: () = {
- static SHARED: NotSync = NotSync { _0: PhantomData };
+ struct Resources {
+ #[init(NotSync { _0: PhantomData })]
+ shared: NotSync,
+ }
#[init]
fn init(_: init::Context) {
debug::exit(debug::EXIT_SUCCESS);
}
- #[task(resources = [SHARED])]
+ #[task(resources = [shared])]
fn foo(c: foo::Context) {
- let _: &NotSync = c.resources.SHARED;
+ let _: &NotSync = c.resources.shared;
}
- #[task(resources = [SHARED])]
+ #[task(resources = [shared])]
fn bar(c: bar::Context) {
- let _: &NotSync = c.resources.SHARED;
+ let _: &NotSync = c.resources.shared;
}
extern "C" {