diff options
author | 2020-10-01 18:45:04 +0000 | |
---|---|---|
committer | 2020-10-01 18:45:04 +0000 | |
commit | decd9112d8267d9e886dcc4470e46a764139c8e3 (patch) | |
tree | ea85444bd80cde6fe21197b0a06523be515fdfa8 /macros/src | |
parent | 4d61437bb4debea5adc578ee072bff3619d8077b (diff) | |
parent | 86001c46bcae85c9448d63dde534bd218301f0e4 (diff) | |
download | rtic-decd9112d8267d9e886dcc4470e46a764139c8e3.tar.gz rtic-decd9112d8267d9e886dcc4470e46a764139c8e3.tar.zst rtic-decd9112d8267d9e886dcc4470e46a764139c8e3.zip |
Merge #373
373: Added `bare_metal::CriticalSection` to `init::Context` r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
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)); } |