diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2021-07-07 22:50:59 +0200 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2021-07-07 23:07:09 +0200 |
| commit | 98d2af9d73da56910c8bb6cb662fbc4d609a704a (patch) | |
| tree | 46914250a980b9164b2d20cbeb08e126a86cf7ea /macros/src/codegen/local_resources_struct.rs | |
| parent | 633012190baa0801efc7e3ab2f699778c5038d54 (diff) | |
Fixing tests
Diffstat (limited to 'macros/src/codegen/local_resources_struct.rs')
| -rw-r--r-- | macros/src/codegen/local_resources_struct.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/macros/src/codegen/local_resources_struct.rs b/macros/src/codegen/local_resources_struct.rs index 0283d52..4bd9e2a 100644 --- a/macros/src/codegen/local_resources_struct.rs +++ b/macros/src/codegen/local_resources_struct.rs @@ -18,6 +18,8 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, Context::SoftwareTask(name) => &app.software_tasks[name].args.local_resources, }; + let task_name = util::get_task_name(ctxt, app); + let mut fields = vec![]; let mut values = vec![]; let mut has_cfgs = false; @@ -41,7 +43,13 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, quote!('a) }; - let mangled_name = util::mark_internal_ident(&util::static_local_resource_ident(name)); + let mangled_name = if matches!(task_local, TaskLocal::External) { + util::mark_internal_ident(&util::static_local_resource_ident(name)) + } else { + util::mark_internal_ident(&util::declared_static_local_resource_ident( + name, &task_name, + )) + }; fields.push(quote!( #(#cfgs)* |
