diff options
author | 2019-07-10 22:42:44 +0200 | |
---|---|---|
committer | 2019-07-10 22:42:44 +0200 | |
commit | 9195038c87703fc94b6e99f6de593886d51c2b19 (patch) | |
tree | 56855952357fe5bb689504ed8a6348dc3c1f3718 /examples/t-late-not-send.rs | |
parent | 14d63f496118f4243f28ddf3218523aa36a80322 (diff) | |
download | rtic-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.rs | 16 |
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 {} } |