diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-07-27 11:40:15 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-07-27 11:40:15 -0500 |
| commit | aa2249454975a203e459597005944f5370c1d200 (patch) | |
| tree | b6cf75b34302cf7681712c82bffa2841631ef998 /examples/preemption.rs | |
| parent | 0b5afce771cb9e5cc42c4fd4c5e18f020bf1ecad (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.rs | 8 |
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) { // .. |
