aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/locals.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-11 12:53:58 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-11 12:53:58 +0200
commitfb84029beef9bec3c205583296b181023f2e4b6b (patch)
tree7d3aea5957526272e8835cccd00ac41e03bf9460 /macros/src/codegen/locals.rs
parent9195038c87703fc94b6e99f6de593886d51c2b19 (diff)
downloadrtic-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.rs6
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!(