From 3cebf49a2feb10b6dbf7e40e4671dbf7a3d8bedf Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 6 Jul 2017 23:25:29 -0500 Subject: syntax tweaks, relax check, add set_pending(), deal with imported types - allow trailing commas in list of resources - make task.resources optional - add rtfm::set_pending function which can be used to force an interrupt into the pending state. This is a replacement of the old rtfm::request. rtfm::set_pending takes the Interrupt enum provided by the device crate as argument. (The old rtfm::request took a task function as argument) - the user may want to use types they imported into the root of the crate. These types are not available in e.g. `mod idle` so `idle::Resources` *can't* be defined in that module. To workaround this problem `idle::Resources` will be defined in the root, with some other name, and then be re-exported in the `idle` module. - remove the "a resource only used by one task should be local data" check. In some cases you do want a resource owned by a single task instead of local data since `init` can access resources but not a task local data. --- macros/src/syntax/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'macros/src/syntax/mod.rs') diff --git a/macros/src/syntax/mod.rs b/macros/src/syntax/mod.rs index 53c17a8..757e05e 100644 --- a/macros/src/syntax/mod.rs +++ b/macros/src/syntax/mod.rs @@ -10,7 +10,7 @@ pub struct App { pub device: Tokens, pub idle: Idle, pub init: Init, - pub resources: Resources, + pub resources: Statics, pub tasks: Tasks, } @@ -21,7 +21,7 @@ pub struct Init { #[derive(Debug)] pub struct Idle { - pub local: Resources, + pub local: Statics, pub path: Tokens, pub resources: HashSet, } @@ -46,6 +46,6 @@ pub struct Resource { pub ty: Tokens, } -pub type Resources = HashMap; +pub type Statics = HashMap; pub type Tasks = HashMap; -- cgit v1.2.3