diff options
author | 2020-10-01 20:01:25 +0200 | |
---|---|---|
committer | 2020-10-01 20:01:25 +0200 | |
commit | fb61a78cdd99e27914cc355f721c04d901dd3ae4 (patch) | |
tree | 15ed9c4d9db6023f667c2d5c863fa1b8b0a4d12d /macros/src | |
parent | 4d61437bb4debea5adc578ee072bff3619d8077b (diff) | |
download | rtic-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.rs | 8 |
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)); } |