diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-07-27 22:40:47 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-07-27 22:40:47 -0500 |
| commit | e85d6e53c89cd1ea1da8826778c5a74154fb651d (patch) | |
| tree | 76fbc30063df22724b9b160c85055e1d294513b0 /examples/two-tasks.rs | |
| parent | 271df39bdba0690ea7ba77a6ff5d8d7edb9b8036 (diff) | |
update examples
Diffstat (limited to 'examples/two-tasks.rs')
| -rw-r--r-- | examples/two-tasks.rs | 15 |
1 files changed, 3 insertions, 12 deletions
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) { // .. |
