aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
authorGravatar Per Lindgren <per.lindgren@ltu.se> 2021-10-18 16:47:21 +0200
committerGravatar Per Lindgren <per.lindgren@ltu.se> 2021-11-03 10:07:10 +0100
commit05586401c79f277b64ec2ee5ccf23bee399c11be (patch)
tree9f6b50fc923b656d897eddb766dac914fb546223 /macros/src/codegen/util.rs
parent4cefde75e8b2ccef4b96a37c84b1e313ba710bcf (diff)
downloadrtic-05586401c79f277b64ec2ee5ccf23bee399c11be.tar.gz
rtic-05586401c79f277b64ec2ee5ccf23bee399c11be.tar.zst
rtic-05586401c79f277b64ec2ee5ccf23bee399c11be.zip
api test (all but lock automated)
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs13
1 files changed, 13 insertions, 0 deletions
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 {