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 /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 'examples')
| -rw-r--r-- | examples/custom-type.rs | 1 | ||||
| -rw-r--r-- | examples/full-syntax.rs | 3 | ||||
| -rw-r--r-- | examples/generics.rs | 3 | ||||
| -rw-r--r-- | examples/late-resources.rs | 1 | ||||
| -rw-r--r-- | examples/nested.rs | 13 | ||||
| -rw-r--r-- | examples/one-task.rs | 1 | ||||
| -rw-r--r-- | examples/preemption.rs | 1 | ||||
| -rw-r--r-- | examples/safe-static-mut-ref.rs | 1 | ||||
| -rw-r--r-- | examples/two-tasks.rs | 1 | ||||
| -rw-r--r-- | examples/zero-tasks.rs | 2 |
10 files changed, 11 insertions, 16 deletions
diff --git a/examples/custom-type.rs b/examples/custom-type.rs index 79d6cc4..826e9dd 100644 --- a/examples/custom-type.rs +++ b/examples/custom-type.rs @@ -1,6 +1,5 @@ #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs index 5b27412..9bdcd7b 100644 --- a/examples/full-syntax.rs +++ b/examples/full-syntax.rs @@ -1,7 +1,6 @@ //! A showcase of the `app!` macro syntax #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; @@ -60,7 +59,7 @@ mod main { 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/examples/generics.rs b/examples/generics.rs index ca7726d..aceba1a 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -1,14 +1,13 @@ //! Working with resources in a generic fashion #![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/examples/late-resources.rs b/examples/late-resources.rs index 07c321f..3bfc388 100644 --- a/examples/late-resources.rs +++ b/examples/late-resources.rs @@ -1,7 +1,6 @@ //! Demonstrates initialization of resources in `init`. #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; diff --git a/examples/nested.rs b/examples/nested.rs index 6af7087..46c00b2 100644 --- a/examples/nested.rs +++ b/examples/nested.rs @@ -4,7 +4,6 @@ //! letters in the comments: A, then B, then C, etc. #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; @@ -60,7 +59,13 @@ fn idle() -> ! { } #[allow(non_snake_case)] -fn exti0(t: &mut Threshold, EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resources) { +fn exti0( + t: &mut Threshold, + 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 @@ -71,7 +76,7 @@ fn exti0(t: &mut Threshold, EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resou 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 @@ -92,7 +97,7 @@ fn exti0(t: &mut Threshold, EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resou 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/examples/one-task.rs b/examples/one-task.rs index c62fbbf..dc2bfd2 100644 --- a/examples/one-task.rs +++ b/examples/one-task.rs @@ -1,7 +1,6 @@ //! An application with one task #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m; diff --git a/examples/preemption.rs b/examples/preemption.rs index 8e50188..340b976 100644 --- a/examples/preemption.rs +++ b/examples/preemption.rs @@ -1,7 +1,6 @@ //! Two tasks running at *different* priorities with access to the same resource #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; diff --git a/examples/safe-static-mut-ref.rs b/examples/safe-static-mut-ref.rs index 81dbde2..9579f52 100644 --- a/examples/safe-static-mut-ref.rs +++ b/examples/safe-static-mut-ref.rs @@ -1,7 +1,6 @@ //! Safe creation of `&'static mut` references #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index 4f567f0..2348915 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -1,7 +1,6 @@ //! Two tasks running at the *same* priority with access to the same resource #![deny(unsafe_code)] #![deny(warnings)] -#![feature(proc_macro)] #![no_std] extern crate cortex_m_rtfm as rtfm; diff --git a/examples/zero-tasks.rs b/examples/zero-tasks.rs index b1ebab6..abd1c4c 100644 --- a/examples/zero-tasks.rs +++ b/examples/zero-tasks.rs @@ -1,8 +1,6 @@ //! Minimal example with zero tasks #![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 |
