diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-01 18:45:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-01 18:45:04 +0000 |
| commit | decd9112d8267d9e886dcc4470e46a764139c8e3 (patch) | |
| tree | ea85444bd80cde6fe21197b0a06523be515fdfa8 /macros/src/codegen/module.rs | |
| parent | 4d61437bb4debea5adc578ee072bff3619d8077b (diff) | |
| parent | 86001c46bcae85c9448d63dde534bd218301f0e4 (diff) | |
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/codegen/module.rs')
| -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 863f6c5..359c1cc 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)); } |
