From 05586401c79f277b64ec2ee5ccf23bee399c11be Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Mon, 18 Oct 2021 16:47:21 +0200 Subject: api test (all but lock automated) --- macros/src/codegen/util.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'macros/src/codegen/util.rs') diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 8e40ad61..d16faf33 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -202,6 +202,19 @@ pub fn shared_resources_ident(ctxt: Context, app: &App) -> Ident { mark_internal_name(&s) } +/// Generates a pre-reexport identifier for the "shared resources" struct +pub fn shared_resources_ident_mut(ctxt: Context, app: &App) -> Ident { + let mut s = match ctxt { + Context::Init => app.init.name.to_string(), + Context::Idle => app.idle.as_ref().unwrap().name.to_string(), + Context::HardwareTask(ident) | Context::SoftwareTask(ident) => ident.to_string(), + }; + + s.push_str("Shared"); + + mark_internal_name(&s) +} + /// Generates a pre-reexport identifier for the "local resources" struct pub fn local_resources_ident(ctxt: Context, app: &App) -> Ident { let mut s = match ctxt { -- cgit v1.2.3