diff options
Diffstat (limited to 'macros/src/codegen/post_init.rs')
-rw-r--r-- | macros/src/codegen/post_init.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macros/src/codegen/post_init.rs b/macros/src/codegen/post_init.rs index 329d700e..5545944d 100644 --- a/macros/src/codegen/post_init.rs +++ b/macros/src/codegen/post_init.rs @@ -2,7 +2,7 @@ use proc_macro2::TokenStream as TokenStream2; use quote::quote; use rtic_syntax::ast::App; -use crate::analyze::Analysis; +use crate::{analyze::Analysis, codegen::util}; /// Generates code that runs after `#[init]` returns pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> { @@ -12,13 +12,14 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> { if !analysis.late_resources.is_empty() { // BTreeSet wrapped in a vector for name in analysis.late_resources.first().unwrap() { + let mangled_name = util::mangle_ident(&name); // If it's live let cfgs = app.late_resources[name].cfgs.clone(); if analysis.locations.get(name).is_some() { // Need to also include the cfgs stmts.push(quote!( #(#cfgs)* - #name.as_mut_ptr().write(late.#name); + #mangled_name.as_mut_ptr().write(late.#name); )); } } |