From d396da59502ef67f624bb4d8927ff8697232f66c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Jul 2017 17:08:42 -0500 Subject: make task.$T.enabled optional and move the logic that differentiates interrupts from exceptions from the crate to the procedural macro logic --- examples/full-syntax.rs | 4 +++- examples/generics.rs | 2 -- examples/modules.rs | 3 --- examples/nested.rs | 3 --- examples/preemption.rs | 1 - examples/two-tasks.rs | 1 - 6 files changed, 3 insertions(+), 11 deletions(-) (limited to 'examples') diff --git a/examples/full-syntax.rs b/examples/full-syntax.rs index 918a2e6..184349b 100644 --- a/examples/full-syntax.rs +++ b/examples/full-syntax.rs @@ -37,7 +37,9 @@ app! { }, TIM2: { - enabled: true, + // tasks are enabled, between `init` and `idle`, by default but they + // can start disabled if `false` is specified here + enabled: false, path: tim2, priority: 1, resources: [CO_OWNED], diff --git a/examples/generics.rs b/examples/generics.rs index 7c261d5..6c6e1d6 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -15,14 +15,12 @@ app! { tasks: { EXTI0: { - enabled: true, path: exti0, priority: 1, resources: [GPIOA, SPI1], }, EXTI1: { - enabled: true, path: exti1, priority: 2, resources: [GPIOA, SPI1], diff --git a/examples/modules.rs b/examples/modules.rs index 313ebc4..6bdf8d9 100644 --- a/examples/modules.rs +++ b/examples/modules.rs @@ -31,14 +31,11 @@ app! { tasks: { SYS_TICK: { path: tasks::sys_tick, - priority: 1, resources: [CO_OWNED, ON, SHARED], }, TIM2: { - enabled: true, path: tasks::tim2, - priority: 1, resources: [CO_OWNED], }, }, diff --git a/examples/nested.rs b/examples/nested.rs index 2cb23f9..92f90cb 100644 --- a/examples/nested.rs +++ b/examples/nested.rs @@ -24,21 +24,18 @@ app! { tasks: { EXTI0: { - enabled: true, path: exti0, priority: 1, resources: [LOW, HIGH], }, EXTI1: { - enabled: true, path: exti1, priority: 2, resources: [LOW], }, EXTI2: { - enabled: true, path: exti2, priority: 3, resources: [HIGH], diff --git a/examples/preemption.rs b/examples/preemption.rs index e117695..057e4fd 100644 --- a/examples/preemption.rs +++ b/examples/preemption.rs @@ -25,7 +25,6 @@ app! { }, TIM2: { - enabled: true, path: tim2, priority: 1, resources: [COUNTER], diff --git a/examples/two-tasks.rs b/examples/two-tasks.rs index 7343137..42b91e4 100644 --- a/examples/two-tasks.rs +++ b/examples/two-tasks.rs @@ -33,7 +33,6 @@ app! { // For interrupts the `enabled` field must be specified. It // indicates if the interrupt will be enabled or disabled once // `idle` starts - enabled: true, path: tim2, priority: 1, resources: [COUNTER], -- cgit v1.2.3