aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/locals.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src/codegen/locals.rs')
-rw-r--r--macros/src/codegen/locals.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/macros/src/codegen/locals.rs b/macros/src/codegen/locals.rs
index 96635637..799ef7a0 100644
--- a/macros/src/codegen/locals.rs
+++ b/macros/src/codegen/locals.rs
@@ -2,7 +2,7 @@ use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use rtfm_syntax::{
ast::{App, Local},
- Context, Map,
+ Context, Core, Map,
};
use crate::codegen::util;
@@ -10,6 +10,7 @@ use crate::codegen::util;
pub fn codegen(
ctxt: Context,
locals: &Map<Local>,
+ core: Core,
app: &App,
) -> (
// locals
@@ -41,6 +42,7 @@ pub fn codegen(
let cfgs = &local.cfgs;
has_cfgs |= !cfgs.is_empty();
+ let section = util::link_section("data", core);
let expr = &local.expr;
let ty = &local.ty;
fields.push(quote!(
@@ -49,6 +51,7 @@ pub fn codegen(
));
items.push(quote!(
#(#cfgs)*
+ #section
static mut #name: #ty = #expr
));
values.push(quote!(