aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-10-15 16:01:07 +0000
committerGravatar GitHub <noreply@github.com> 2020-10-15 16:01:07 +0000
commit1cda9eaeccbfd9b008bfa40b54b127a2bfa5324e (patch)
treea17b4ec23f91483649f928021303ebf234727326 /macros/src/codegen.rs
parentee0885063d5b1cc4eddd3918ff425796f6213464 (diff)
parent37ee3a47afbbbf57751243d6d32aaac78073780c (diff)
downloadrtic-1cda9eaeccbfd9b008bfa40b54b127a2bfa5324e.tar.gz
rtic-1cda9eaeccbfd9b008bfa40b54b127a2bfa5324e.tar.zst
rtic-1cda9eaeccbfd9b008bfa40b54b127a2bfa5324e.zip
Merge #371
371: task_local and lock_free r=korken89 a=AfoHT Getting this going to test with GHA For further discussion see https://github.com/rtic-rs/rfcs/issues/30 Co-authored-by: Per <Per Lindgren> Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to 'macros/src/codegen.rs')
-rw-r--r--macros/src/codegen.rs17
1 files changed, 17 insertions, 0 deletions
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