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

@ -21,7 +21,6 @@ app! {
tasks: {
EXTI0: {
enabled: true,
path: exti0,
priority: 1,
resources: [ON],

View file

@ -9,7 +9,6 @@ use rtfm::app;
app! {
//~^ error proc macro panicked
//~| help parsing
device: stm32f103xx,
tasks: {

View file

@ -7,9 +7,7 @@ extern crate stm32f103xx;
use rtfm::app;
app! {
//~^ error no associated item named `SYS_TICK` found for type
//~| error no associated item named `SYS_TICK` found for type
app! { //~ error proc macro panicked
device: stm32f103xx,
tasks: {

View file

@ -7,14 +7,14 @@ extern crate stm32f103xx;
use rtfm::app;
app! { //~ error no associated item named `EXTI0` found for type
app! {
//~^ error no associated item named `EXTI33` found for type
//~| error no associated item named `EXTI33` found for type
device: stm32f103xx,
tasks: {
// ERROR `enabled` needs to be specified for interrupts
EXTI0: {
priority: 1,
},
// ERROR this interrupt doesn't exist
EXTI33: {},
},
}

View file

@ -18,21 +18,18 @@ app! {
tasks: {
EXTI0: {
enabled: true,
path: exti0,
priority: 1,
resources: [MAX, ON],
},
EXTI1: {
enabled: true,
path: exti1,
priority: 2,
resources: [ON],
},
EXTI2: {
enabled: true,
path: exti2,
priority: 16,
resources: [MAX],

View file

@ -17,14 +17,12 @@ app! {
tasks: {
EXTI0: {
enabled: true,
path: exti0,
priority: 1,
resources: [STATE],
},
EXTI1: {
enabled: true,
path: exti1,
priority: 2,
resources: [STATE],

View file

@ -17,7 +17,6 @@ app! { //~ error bound `rtfm::Threshold: core::marker::Send` is not satisfied
tasks: {
EXTI0: {
enabled: true,
path: exti0,
priority: 1,
resources: [TOKEN],

View file

@ -18,14 +18,12 @@ app! {
tasks: {
EXTI0: {
enabled: true,
path: exti0,
priority: 1,
resources: [A, B],
},
EXTI1: {
enabled: true,
path: exti1,
priority: 2,
resources: [A, B],