aboutsummaryrefslogtreecommitdiff
path: root/macros/src
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-01 20:01:25 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-01 20:01:25 +0200
commitfb61a78cdd99e27914cc355f721c04d901dd3ae4 (patch)
tree15ed9c4d9db6023f667c2d5c863fa1b8b0a4d12d /macros/src
parent4d61437bb4debea5adc578ee072bff3619d8077b (diff)
downloadrtic-fb61a78cdd99e27914cc355f721c04d901dd3ae4.tar.gz
rtic-fb61a78cdd99e27914cc355f721c04d901dd3ae4.tar.zst
rtic-fb61a78cdd99e27914cc355f721c04d901dd3ae4.zip
Added `bare_metal::CriticalSection` to `init::Context`
Diffstat (limited to 'macros/src')
-rw-r--r--macros/src/codegen/module.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs
index 863f6c5b..359c1cce 100644
--- a/macros/src/codegen/module.rs
+++ b/macros/src/codegen/module.rs
@@ -47,6 +47,14 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) ->
values.push(quote!(device: #device::Peripherals::steal()));
}
+ lt = Some(quote!('a));
+ fields.push(quote!(
+ /// Critical section token for init
+ pub cs: rtic::export::CriticalSection<#lt>
+ ));
+
+ values.push(quote!(cs: rtic::export::CriticalSection::new()));
+
values.push(quote!(core));
}