diff options
author | 2023-01-07 14:06:11 +0100 | |
---|---|---|
committer | 2023-03-01 00:31:07 +0100 | |
commit | 29228c47239f12794feb91ae5a81d748530c40dc (patch) | |
tree | 4584be2b0b36e9626193a5745cc2551c75692b66 /macros/src/codegen/init.rs | |
parent | 9247252cc74fab4a421f8e8370b29c37ca2fa48a (diff) | |
download | rtic-29228c47239f12794feb91ae5a81d748530c40dc.tar.gz rtic-29228c47239f12794feb91ae5a81d748530c40dc.tar.zst rtic-29228c47239f12794feb91ae5a81d748530c40dc.zip |
Main in main codegen
Diffstat (limited to 'macros/src/codegen/init.rs')
-rw-r--r-- | macros/src/codegen/init.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/macros/src/codegen/init.rs b/macros/src/codegen/init.rs index 2aa8fb31..3b2bcd47 100644 --- a/macros/src/codegen/init.rs +++ b/macros/src/codegen/init.rs @@ -18,8 +18,6 @@ type CodegenResult = ( Vec<TokenStream2>, // user_init -- the `#[init]` function written by the user TokenStream2, - // call_init -- the call to the user `#[init]` - TokenStream2, ); /// Generates support code for `#[init]` functions @@ -63,6 +61,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> CodegenResult { ) }) .collect(); + root_init.push(quote! { struct #shared { #(#shared_resources)* @@ -97,11 +96,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> CodegenResult { mod_app = Some(constructor); } - let call_init = quote! { - let (shared_resources, local_resources) = #name(#name::Context::new(core.into())); - }; - root_init.push(module::codegen(Context::Init, app, analysis)); - (mod_app, root_init, user_init, call_init) + (mod_app, root_init, user_init) } |