diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-08-24 14:36:59 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-08-24 14:36:59 +0000 |
| commit | 62a232f5c64890e2d666d23227df1c21675fc863 (patch) | |
| tree | 78dc3e80181da30d331e0ac3634dfa99c4784498 /src/examples | |
| parent | 53dbbad891e1c223ba5b1939e114b37667011f11 (diff) | |
| parent | 90c9f64c5a010944bc1bc4efb308f18e0af9100a (diff) | |
Merge #85
85: fix master r=japaric a=japaric
closes #80
Co-authored-by: Ferdia McKeogh <chocol4te@users.noreply.github.com>
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'src/examples')
| -rw-r--r-- | src/examples/_0_zero_tasks.rs | 2 | ||||
| -rw-r--r-- | src/examples/_1_one_task.rs | 1 | ||||
| -rw-r--r-- | src/examples/_2_two_tasks.rs | 1 | ||||
| -rw-r--r-- | src/examples/_3_preemption.rs | 1 | ||||
| -rw-r--r-- | src/examples/_4_nested.rs | 12 | ||||
| -rw-r--r-- | src/examples/_5_late_resources.rs | 1 | ||||
| -rw-r--r-- | src/examples/_6_safe_static_mut_ref.rs | 1 | ||||
| -rw-r--r-- | src/examples/_7_generics.rs | 3 | ||||
| -rw-r--r-- | src/examples/_8_full_syntax.rs | 3 |
9 files changed, 9 insertions, 16 deletions
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) { |
