aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/custom-type.rs1
-rw-r--r--examples/full-syntax.rs3
-rw-r--r--examples/generics.rs3
-rw-r--r--examples/late-resources.rs1
-rw-r--r--examples/nested.rs13
-rw-r--r--examples/one-task.rs1
-rw-r--r--examples/preemption.rs1
-rw-r--r--examples/safe-static-mut-ref.rs1
-rw-r--r--examples/two-tasks.rs1
-rw-r--r--examples/zero-tasks.rs2
10 files changed, 11 insertions, 16 deletions
diff --git a/examples/custom-type.rs b/examples/custom-type.rs
index 79d6cc46..826e9dd1 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 5b274122..9bdcd7b4 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 ca7726d0..aceba1a9 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 07c321f6..3bfc3884 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 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
diff --git a/examples/one-task.rs b/examples/one-task.rs
index c62fbbfe..dc2bfd29 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 8e501887..340b9766 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 81dbde26..9579f523 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 4f567f0c..23489151 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 b1ebab6f..abd1c4cd 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