From abca8299268e55bdb80b649ceb6b0cc5d0f3c34a Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 24 Aug 2018 16:31:04 +0200 Subject: more fixes --- src/examples/_0_zero_tasks.rs | 2 -- src/examples/_1_one_task.rs | 1 - src/examples/_2_two_tasks.rs | 1 - src/examples/_3_preemption.rs | 1 - src/examples/_4_nested.rs | 12 +++++++----- src/examples/_5_late_resources.rs | 1 - src/examples/_6_safe_static_mut_ref.rs | 1 - src/examples/_7_generics.rs | 3 +-- src/examples/_8_full_syntax.rs | 3 +-- src/lib.rs | 1 - 10 files changed, 9 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/examples/_0_zero_tasks.rs b/src/examples/_0_zero_tasks.rs index 90f16d4..0484bb9 100644 --- a/src/examples/_0_zero_tasks.rs +++ b/src/examples/_0_zero_tasks.rs @@ -3,8 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! // IMPORTANT always include this feature gate -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; // IMPORTANT always do this rename diff --git a/src/examples/_1_one_task.rs b/src/examples/_1_one_task.rs index c9004e8..b9075a5 100644 --- a/src/examples/_1_one_task.rs +++ b/src/examples/_1_one_task.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m; diff --git a/src/examples/_2_two_tasks.rs b/src/examples/_2_two_tasks.rs index cf6b33d..516ff0c 100644 --- a/src/examples/_2_two_tasks.rs +++ b/src/examples/_2_two_tasks.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; diff --git a/src/examples/_3_preemption.rs b/src/examples/_3_preemption.rs index 4360185..14c9d92 100644 --- a/src/examples/_3_preemption.rs +++ b/src/examples/_3_preemption.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; diff --git a/src/examples/_4_nested.rs b/src/examples/_4_nested.rs index e211cf8..26f8fd8 100644 --- a/src/examples/_4_nested.rs +++ b/src/examples/_4_nested.rs @@ -6,14 +6,13 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; //! extern crate stm32f103xx; //! -//! use stm32f103xx::Interrupt; //! use rtfm::{app, Resource, Threshold}; +//! use stm32f103xx::Interrupt; //! //! app! { //! device: stm32f103xx, @@ -64,7 +63,10 @@ //! #[allow(non_snake_case)] //! fn exti0( //! t: &mut Threshold, -//! EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resources, +//! EXTI0::Resources { +//! LOW: mut low, +//! HIGH: mut high, +//! }: EXTI0::Resources, //! ) { //! // Because this task has a priority of 1 the preemption threshold `t` also //! // starts at 1 @@ -76,7 +78,7 @@ //! rtfm::set_pending(Interrupt::EXTI1); // ~> exti1 //! //! // A claim creates a critical section -//! LOW.claim_mut(t, |_low, t| { +//! low.claim_mut(t, |_low, t| { //! // This claim increases the preemption threshold to 2 //! // //! // 2 is just high enough to not race with task `exti1` for access to the @@ -97,7 +99,7 @@ //! rtfm::bkpt(); //! //! // Claims can be nested -//! HIGH.claim_mut(t, |_high, _| { +//! high.claim_mut(t, |_high, _| { //! // This claim increases the preemption threshold to 3 //! //! // Now `exti2` can't preempt this task diff --git a/src/examples/_5_late_resources.rs b/src/examples/_5_late_resources.rs index 8958e85..7ab90a4 100644 --- a/src/examples/_5_late_resources.rs +++ b/src/examples/_5_late_resources.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; diff --git a/src/examples/_6_safe_static_mut_ref.rs b/src/examples/_6_safe_static_mut_ref.rs index 32eb3d9..8f7267f 100644 --- a/src/examples/_6_safe_static_mut_ref.rs +++ b/src/examples/_6_safe_static_mut_ref.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; diff --git a/src/examples/_7_generics.rs b/src/examples/_7_generics.rs index 22bb777..5dafdbf 100644 --- a/src/examples/_7_generics.rs +++ b/src/examples/_7_generics.rs @@ -3,14 +3,13 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; //! extern crate stm32f103xx; //! //! use rtfm::{app, Resource, Threshold}; -//! use stm32f103xx::{SPI1, GPIOA}; +//! use stm32f103xx::{GPIOA, SPI1}; //! //! app! { //! device: stm32f103xx, diff --git a/src/examples/_8_full_syntax.rs b/src/examples/_8_full_syntax.rs index f8db408..cc7fbc2 100644 --- a/src/examples/_8_full_syntax.rs +++ b/src/examples/_8_full_syntax.rs @@ -3,7 +3,6 @@ //! ``` //! #![deny(unsafe_code)] //! #![deny(warnings)] -//! #![feature(proc_macro)] //! #![no_std] //! //! extern crate cortex_m_rtfm as rtfm; @@ -62,7 +61,7 @@ //! //! pub fn idle(t: &mut Threshold, mut r: ::idle::Resources) -> ! { //! loop { -//! *r.OWNED != *r.OWNED; +//! *r.OWNED = !*r.OWNED; //! //! if *r.OWNED { //! if r.SHARED.claim(t, |shared, _| *shared) { diff --git a/src/lib.rs b/src/lib.rs index 8e5884c..9d55887 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,7 +79,6 @@ //! [rtfm]: http://www.diva-portal.org/smash/get/diva2:1005680/FULLTEXT01.pdf #![deny(missing_docs)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m; -- cgit v1.2.3