From e85d6e53c89cd1ea1da8826778c5a74154fb651d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Jul 2017 22:40:47 -0500 Subject: update examples --- examples/two-tasks.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'examples/two-tasks.rs') diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index 42b91e4..ea059a0 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -1,4 +1,4 @@ -//! Two tasks running at the same priority with access to the same resource +//! Two tasks running at the *same* priority with access to the same resource #![deny(unsafe_code)] #![feature(const_fn)] @@ -13,34 +13,25 @@ use rtfm::{app, Threshold}; app! { device: stm32f103xx, - // Resources that are plain data, not peripherals resources: { - // Declaration of resources looks like the declaration of `static` - // variables static COUNTER: u64 = 0; }, + // Both SYS_TICK and TIM2 have access to the `COUNTER` data tasks: { SYS_TICK: { path: sys_tick, - priority: 1, - // Both this task and TIM2 have access to the `COUNTER` resource resources: [COUNTER], }, - // An interrupt as a task TIM2: { - // For interrupts the `enabled` field must be specified. It - // indicates if the interrupt will be enabled or disabled once - // `idle` starts path: tim2, - priority: 1, resources: [COUNTER], }, }, } -// when data resources are declared in the top `resources` field, `init` will +// When data resources are declared in the top `resources` field, `init` will // have full access to them fn init(_p: init::Peripherals, _r: init::Resources) { // .. -- cgit v1.2.3