From c631049efcadca8b07940c794cce2be58fa48444 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 3 Nov 2018 17:02:41 +0100 Subject: v0.4.0 closes #32 closes #33 --- examples/not-sync.rs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 examples/not-sync.rs (limited to 'examples/not-sync.rs') diff --git a/examples/not-sync.rs b/examples/not-sync.rs new file mode 100644 index 0000000..d94e0a0 --- /dev/null +++ b/examples/not-sync.rs @@ -0,0 +1,41 @@ +//! `examples/not-sync.rs` + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate panic_halt; + +use core::marker::PhantomData; + +use cortex_m_semihosting::debug; +use rtfm::app; + +pub struct NotSync { + _0: PhantomData<*const ()>, +} + +#[app(device = lm3s6965)] +const APP: () = { + static SHARED: NotSync = NotSync { _0: PhantomData }; + + #[init] + fn init() { + debug::exit(debug::EXIT_SUCCESS); + } + + #[task(resources = [SHARED])] + fn foo() { + let _: &NotSync = resources.SHARED; + } + + #[task(resources = [SHARED])] + fn bar() { + let _: &NotSync = resources.SHARED; + } + + extern "C" { + fn UART0(); + } +}; -- cgit v1.2.3