diff options
author | 2023-01-07 14:26:55 +0100 | |
---|---|---|
committer | 2023-03-01 00:31:08 +0100 | |
commit | 76595b7aedd2a14aea8569b75fabe62120f93230 (patch) | |
tree | 5b94ff5b348a57347066e97f1bac8dda1d716b80 /macros/src/codegen/hardware_tasks.rs | |
parent | b054e871d486e8eb35e3c98a73652640238c5e7d (diff) | |
download | rtic-76595b7aedd2a14aea8569b75fabe62120f93230.tar.gz rtic-76595b7aedd2a14aea8569b75fabe62120f93230.tar.zst rtic-76595b7aedd2a14aea8569b75fabe62120f93230.zip |
All codegen is now explicit
Diffstat (limited to 'macros/src/codegen/hardware_tasks.rs')
-rw-r--r-- | macros/src/codegen/hardware_tasks.rs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index 9ea5825b..8a5a8f6c 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -7,20 +7,7 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; /// Generate support code for hardware tasks (`#[exception]`s and `#[interrupt]`s) -pub fn codegen( - app: &App, - analysis: &Analysis, -) -> ( - // mod_app_hardware_tasks -- interrupt handlers and `${task}Resources` constructors - Vec<TokenStream2>, - // root_hardware_tasks -- items that must be placed in the root of the crate: - // - `${task}Locals` structs - // - `${task}Resources` structs - // - `${task}` modules - Vec<TokenStream2>, - // user_hardware_tasks -- the `#[task]` functions written by the user - Vec<TokenStream2>, -) { +pub fn codegen(app: &App, analysis: &Analysis) -> TokenStream2 { let mut mod_app = vec![]; let mut root = vec![]; let mut user_tasks = vec![]; @@ -90,5 +77,11 @@ pub fn codegen( } } - (mod_app, root, user_tasks) + quote!( + #(#mod_app)* + + #(#root)* + + #(#user_tasks)* + ) } |