diff options
Diffstat (limited to 'examples/nested.rs')
-rw-r--r-- | examples/nested.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/nested.rs b/examples/nested.rs index 6af70879..46c00b2b 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 |