From f96b25fdf2d7421cc16830a4ccac4ebb3e69cc5d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 15 Oct 2020 18:50:17 +0200 Subject: Updated examples More work --- macros/src/codegen/util.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'macros/src/codegen/util.rs') diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index f04ccb23..887ee3bd 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -106,6 +106,14 @@ pub fn late_resources_ident(init: &Ident) -> Ident { ) } +/// Mangle an ident +pub fn mangle_ident(ident: &Ident) -> Ident { + Ident::new( + &format!("__rtic_internal_{}", ident.to_string()), + Span::call_site(), + ) +} + fn link_section_index() -> usize { static INDEX: AtomicUsize = AtomicUsize::new(0); -- cgit v1.2.3 From d2ac641c3f2fb8f6f189d3650fed25063049c80b Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 21 Oct 2020 20:24:06 +0200 Subject: Hide lock type better to not collide with user types --- macros/src/codegen/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'macros/src/codegen/util.rs') diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 887ee3bd..d78da61d 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -53,7 +53,7 @@ pub fn impl_mutex( type T = #ty; #[inline(always)] - fn lock(&mut self, f: impl FnOnce(&mut #ty) -> R) -> R { + fn lock(&mut self, f: impl FnOnce(&mut #ty) -> RTIC_INTERNAL_R) -> RTIC_INTERNAL_R { /// Priority ceiling const CEILING: u8 = #ceiling; -- cgit v1.2.3