aboutsummaryrefslogtreecommitdiff
path: root/examples/nested.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <bors[bot]@users.noreply.github.com> 2018-08-24 14:36:59 +0000
committerGravatar bors[bot] <bors[bot]@users.noreply.github.com> 2018-08-24 14:36:59 +0000
commit62a232f5c64890e2d666d23227df1c21675fc863 (patch)
tree78dc3e80181da30d331e0ac3634dfa99c4784498 /examples/nested.rs
parent53dbbad891e1c223ba5b1939e114b37667011f11 (diff)
parent90c9f64c5a010944bc1bc4efb308f18e0af9100a (diff)
downloadrtic-62a232f5c64890e2d666d23227df1c21675fc863.tar.gz
rtic-62a232f5c64890e2d666d23227df1c21675fc863.tar.zst
rtic-62a232f5c64890e2d666d23227df1c21675fc863.zip
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/nested.rs')
-rw-r--r--examples/nested.rs13
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