aboutsummaryrefslogtreecommitdiff
path: root/examples/t-late-not-send.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/t-late-not-send.rs
parent14d63f496118f4243f28ddf3218523aa36a80322 (diff)
downloadrtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.gz
rtic-9195038c87703fc94b6e99f6de593886d51c2b19.tar.zst
rtic-9195038c87703fc94b6e99f6de593886d51c2b19.zip
implement RFC #212
Diffstat (limited to 'examples/t-late-not-send.rs')
-rw-r--r--examples/t-late-not-send.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs
index 55a053df..4fd3504e 100644
--- a/examples/t-late-not-send.rs
+++ b/examples/t-late-not-send.rs
@@ -13,23 +13,23 @@ pub struct NotSend {
#[rtfm::app(device = lm3s6965)]
const APP: () = {
- extern "C" {
- static mut X: NotSend;
+ struct Resources {
+ x: NotSend,
+ #[init(None)]
+ y: Option<NotSend>,
}
- static mut Y: Option<NotSend> = None;
-
- #[init(resources = [Y])]
+ #[init(resources = [y])]
fn init(c: init::Context) -> init::LateResources {
// equivalent to late resource initialization
- *c.resources.Y = Some(NotSend { _0: PhantomData });
+ *c.resources.y = Some(NotSend { _0: PhantomData });
init::LateResources {
- X: NotSend { _0: PhantomData },
+ x: NotSend { _0: PhantomData },
}
}
- #[idle(resources = [X, Y])]
+ #[idle(resources = [x, y])]
fn idle(_: idle::Context) -> ! {
loop {}
}