diff options
author | 2019-07-11 12:53:58 +0200 | |
---|---|---|
committer | 2019-07-11 12:53:58 +0200 | |
commit | fb84029beef9bec3c205583296b181023f2e4b6b (patch) | |
tree | 7d3aea5957526272e8835cccd00ac41e03bf9460 /macros/src/codegen/locals.rs | |
parent | 9195038c87703fc94b6e99f6de593886d51c2b19 (diff) | |
download | rtic-fb84029beef9bec3c205583296b181023f2e4b6b.tar.gz rtic-fb84029beef9bec3c205583296b181023f2e4b6b.tar.zst rtic-fb84029beef9bec3c205583296b181023f2e4b6b.zip |
implement the #[shared] attribute as specified in RFC #211
Diffstat (limited to 'macros/src/codegen/locals.rs')
-rw-r--r-- | macros/src/codegen/locals.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/macros/src/codegen/locals.rs b/macros/src/codegen/locals.rs index 799ef7a0..cbfe05fb 100644 --- a/macros/src/codegen/locals.rs +++ b/macros/src/codegen/locals.rs @@ -42,7 +42,11 @@ pub fn codegen( let cfgs = &local.cfgs; has_cfgs |= !cfgs.is_empty(); - let section = util::link_section("data", core); + let section = if local.shared && cfg!(feature = "heterogeneous") { + Some(quote!(#[rtfm::export::shared])) + } else { + util::link_section("data", core) + }; let expr = &local.expr; let ty = &local.ty; fields.push(quote!( |