aboutsummaryrefslogtreecommitdiff
path: root/examples/generics.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2017-07-27 11:40:15 -0500
committerGravatar Jorge Aparicio <jorge@japaric.io> 2017-07-27 11:40:15 -0500
commitaa2249454975a203e459597005944f5370c1d200 (patch)
treeb6cf75b34302cf7681712c82bffa2841631ef998 /examples/generics.rs
parent0b5afce771cb9e5cc42c4fd4c5e18f020bf1ecad (diff)
downloadrtic-aa2249454975a203e459597005944f5370c1d200.tar.gz
rtic-aa2249454975a203e459597005944f5370c1d200.tar.zst
rtic-aa2249454975a203e459597005944f5370c1d200.zip
update tests and examples
with task! gone 3 types of errors / gotchas have been eliminated :tada:
Diffstat (limited to 'examples/generics.rs')
-rw-r--r--examples/generics.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/generics.rs b/examples/generics.rs
index 335d159b..7c261d54 100644
--- a/examples/generics.rs
+++ b/examples/generics.rs
@@ -4,7 +4,6 @@
#![feature(proc_macro)]
#![no_std]
-#[macro_use(task)]
extern crate cortex_m_rtfm as rtfm;
extern crate stm32f103xx;
@@ -17,12 +16,14 @@ app! {
tasks: {
EXTI0: {
enabled: true,
+ path: exti0,
priority: 1,
resources: [GPIOA, SPI1],
},
EXTI1: {
enabled: true,
+ path: exti1,
priority: 2,
resources: [GPIOA, SPI1],
},
@@ -54,15 +55,11 @@ where
});
}
-task!(EXTI0, exti0);
-
// this task needs critical sections to access the resources
fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
work(t, &r.GPIOA, &r.SPI1);
}
-task!(EXTI1, exti1);
-
// this task has direct access to the resources
fn exti1(t: &mut Threshold, r: EXTI1::Resources) {
work(t, r.GPIOA, r.SPI1);