From 81275bfa4f41e2066770087f3a33cad4227eab41 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 13 Jun 2019 23:56:59 +0200 Subject: rtfm-syntax refactor + heterogeneous multi-core support --- examples/not-sync.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/not-sync.rs') diff --git a/examples/not-sync.rs b/examples/not-sync.rs index bc71406..6b49911 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -5,11 +5,10 @@ #![no_main] #![no_std] -extern crate panic_halt; - use core::marker::PhantomData; use cortex_m_semihosting::debug; +use panic_halt as _; pub struct NotSync { _0: PhantomData<*const ()>, -- cgit v1.2.3 From 9195038c87703fc94b6e99f6de593886d51c2b19 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 10 Jul 2019 22:42:44 +0200 Subject: implement RFC #212 --- examples/not-sync.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'examples/not-sync.rs') diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 6b49911..f0f6075 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" { -- cgit v1.2.3 From 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 10:17:27 +0200 Subject: doc up --- examples/not-sync.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/not-sync.rs') diff --git a/examples/not-sync.rs b/examples/not-sync.rs index f0f6075..7ce2a82 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -26,12 +26,12 @@ const APP: () = { debug::exit(debug::EXIT_SUCCESS); } - #[task(resources = [shared])] + #[task(resources = [&shared])] fn foo(c: foo::Context) { let _: &NotSync = c.resources.shared; } - #[task(resources = [shared])] + #[task(resources = [&shared])] fn bar(c: bar::Context) { let _: &NotSync = c.resources.shared; } -- cgit v1.2.3