aboutsummaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/Cargo.toml3
-rw-r--r--macros/src/codegen.rs17
2 files changed, 19 insertions, 1 deletions
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 610890bb..a9f268fb 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -19,7 +19,8 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
+proc-macro-error = "1"
quote = "1"
syn = "1"
-rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax", branch = "master", version = "0.4.0" }
+rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax", branch = "master", version = "0.5.0-alpha.0" }
diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs
index e89776c5..a256ac75 100644
--- a/macros/src/codegen.rs
+++ b/macros/src/codegen.rs
@@ -126,6 +126,20 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
let user_code = app.user_code.clone();
let name = &app.name;
let device = extra.device;
+
+ // Get the list of all tasks
+ // Currently unused, might be useful
+ let task_list = analysis.tasks.clone();
+
+ let mut tasks = vec![];
+ if !task_list.is_empty() {
+ tasks.push(quote!(
+ enum Tasks {
+ #(#task_list),*
+ }
+ ));
+ }
+
quote!(
#(#user)*
@@ -141,6 +155,9 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
#(#root_software_tasks)*
+ /// Unused
+ #(#tasks)*
+
/// Implementation details
mod #name {
/// Always include the device crate which contains the vector table