make task.$T.enabled optional

and move the logic that differentiates interrupts from exceptions from the crate
to the procedural macro logic
This commit is contained in:
Jorge Aparicio 2017-07-27 17:08:42 -05:00
parent ad2a523cf9
commit d396da5950
17 changed files with 112 additions and 92 deletions

View file

@ -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],

View file

@ -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],

View file

@ -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],
},
},

View file

@ -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],

View file

@ -25,7 +25,6 @@ app! {
},
TIM2: {
enabled: true,
path: tim2,
priority: 1,
resources: [COUNTER],

View file

@ -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],