aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2022-04-20 11:35:08 +0000
committerGravatar GitHub <noreply@github.com> 2022-04-20 11:35:08 +0000
commitd1aa20643d39d033d43e4ab919c4a83601388c53 (patch)
tree42fe0077801e832320d23322f2259332e6d88d1f /macros/src/codegen/util.rs
parent87074180034fb682f3945b1391b09060c7058424 (diff)
parent0f8bdbdd3f2739e37d788493cb83cf2d9c557f4e (diff)
downloadrtic-d1aa20643d39d033d43e4ab919c4a83601388c53.tar.gz
rtic-d1aa20643d39d033d43e4ab919c4a83601388c53.tar.zst
rtic-d1aa20643d39d033d43e4ab919c4a83601388c53.zip
Merge #635
635: Masks take 3 r=AfoHT a=korken89 This solves the `MASKS` generation issue by having `rtic::export` do the feature gating. Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs
index 4a29754b..0f3dca7c 100644
--- a/macros/src/codegen/util.rs
+++ b/macros/src/codegen/util.rs
@@ -36,6 +36,7 @@ pub fn impl_mutex(
};
let device = &extra.device;
+ let masks_name = priority_masks_ident();
quote!(
#(#cfgs)*
impl<'a> rtic::Mutex for #path<'a> {
@@ -52,7 +53,7 @@ pub fn impl_mutex(
#priority,
CEILING,
#device::NVIC_PRIO_BITS,
- &MASKS,
+ &#masks_name,
f,
)
}
@@ -252,6 +253,10 @@ pub fn static_shared_resource_ident(name: &Ident) -> Ident {
mark_internal_name(&format!("shared_resource_{}", name))
}
+pub fn priority_masks_ident() -> Ident {
+ mark_internal_name("MASKS")
+}
+
pub fn static_local_resource_ident(name: &Ident) -> Ident {
mark_internal_name(&format!("local_resource_{}", name))
}