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/preemption.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'examples/preemption.rs') diff --git a/examples/preemption.rs b/examples/preemption.rs index 2ca6f95..e117695 100644 --- a/examples/preemption.rs +++ b/examples/preemption.rs @@ -1,11 +1,9 @@ //! Two tasks running at different priorities with access to the same resource - #![deny(unsafe_code)] #![feature(const_fn)] #![feature(proc_macro)] #![no_std] -#[macro_use(task)] extern crate cortex_m_rtfm as rtfm; extern crate stm32f103xx; @@ -21,12 +19,14 @@ app! { tasks: { // the task `SYS_TICK` has higher priority than `TIM2` SYS_TICK: { + path: sys_tick, priority: 2, resources: [COUNTER], }, TIM2: { enabled: true, + path: tim2, priority: 1, resources: [COUNTER], }, @@ -43,8 +43,6 @@ fn idle() -> ! { } } -task!(SYS_TICK, sys_tick); - fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // .. @@ -55,8 +53,6 @@ fn sys_tick(_t: &mut Threshold, r: SYS_TICK::Resources) { // .. } -task!(TIM2, tim2); - fn tim2(t: &mut Threshold, mut r: TIM2::Resources) { // .. -- cgit v1.2.3