aboutsummaryrefslogtreecommitdiff
path: root/examples/preemption.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/preemption.rs
parent0b5afce771cb9e5cc42c4fd4c5e18f020bf1ecad (diff)
update tests and examples
with task! gone 3 types of errors / gotchas have been eliminated :tada:
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 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) {
// ..