From 76595b7aedd2a14aea8569b75fabe62120f93230 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sat, 7 Jan 2023 14:26:55 +0100 Subject: All codegen is now explicit --- macros/src/codegen/hardware_tasks.rs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'macros/src/codegen/hardware_tasks.rs') 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, - // root_hardware_tasks -- items that must be placed in the root of the crate: - // - `${task}Locals` structs - // - `${task}Resources` structs - // - `${task}` modules - Vec, - // user_hardware_tasks -- the `#[task]` functions written by the user - Vec, -) { +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)* + ) } -- cgit v1.2.3