aboutsummaryrefslogtreecommitdiff
path: root/examples/two-tasks.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2017-07-27 11:40:15 -0500
committerJorge Aparicio <jorge@japaric.io>2017-07-27 11:40:15 -0500
commitaa2249454975a203e459597005944f5370c1d200 (patch)
treeb6cf75b34302cf7681712c82bffa2841631ef998 /examples/two-tasks.rs
parent0b5afce771cb9e5cc42c4fd4c5e18f020bf1ecad (diff)
update tests and examples
with task! gone 3 types of errors / gotchas have been eliminated :tada:
Diffstat (limited to 'examples/two-tasks.rs')
-rw-r--r--examples/two-tasks.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs
index eb74fa8..7343137 100644
--- a/examples/two-tasks.rs
+++ b/examples/two-tasks.rs
@@ -5,7 +5,6 @@
#![feature(proc_macro)]
#![no_std]
-#[macro_use(task)]
extern crate cortex_m_rtfm as rtfm;
extern crate stm32f103xx;
@@ -23,6 +22,7 @@ app! {
tasks: {
SYS_TICK: {
+ path: sys_tick,
priority: 1,
// Both this task and TIM2 have access to the `COUNTER` resource
resources: [COUNTER],
@@ -34,6 +34,7 @@ app! {
// indicates if the interrupt will be enabled or disabled once
// `idle` starts
enabled: true,
+ path: tim2,
priority: 1,
resources: [COUNTER],
},
@@ -52,8 +53,6 @@ fn idle() -> ! {
}
}
-task!(SYS_TICK, sys_tick);
-
// As both tasks are running at the same priority one can't preempt the other.
// Thus both tasks have direct access to the resource
fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) {
@@ -64,8 +63,6 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) {
// ..
}
-task!(TIM2, tim2);
-
fn tim2(_t: &mut Threshold, r: TIM2::Resources) {
// ..