From aa2249454975a203e459597005944f5370c1d200 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Jul 2017 11:40:15 -0500 Subject: update tests and examples with task! gone 3 types of errors / gotchas have been eliminated :tada: --- examples/two-tasks.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'examples/two-tasks.rs') 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) { // .. -- cgit v1.2.3