aboutsummaryrefslogtreecommitdiff
path: root/examples/preemption.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/preemption.rs')
-rw-r--r--examples/preemption.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/preemption.rs b/examples/preemption.rs
index 2ca6f951..e1176958 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) {
// ..