diff options
author | 2021-09-27 13:31:19 +0000 | |
---|---|---|
committer | 2021-09-27 13:31:19 +0000 | |
commit | 8940c50fa739f47045ce45b23422645bf4922538 (patch) | |
tree | 853b52e0ecb1836ffe0083a9a00ea74abfeab105 /macros/src/codegen | |
parent | 58a492057654610055b2cad08a227e0b76a57a77 (diff) | |
parent | 9a0d27a91e83cfd2847c9f389bb92695f384c66c (diff) | |
download | rtic-8940c50fa739f47045ce45b23422645bf4922538.tar.gz rtic-8940c50fa739f47045ce45b23422645bf4922538.tar.zst rtic-8940c50fa739f47045ce45b23422645bf4922538.zip |
Merge #529
529: Updated codegen for the updated syntax (default monotonic priority) r=AfoHT a=korken89
Needs new syntax release before merge.
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'macros/src/codegen')
-rw-r--r-- | macros/src/codegen/pre_init.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index 69f16fe3..eb216d86 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -83,7 +83,11 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream // Initialize monotonic's interrupts for (_, monotonic) in &app.monotonics { - let priority = &monotonic.args.priority; + let priority = if let Some(prio) = monotonic.args.priority { + quote! { #prio } + } else { + quote! { (1 << #nvic_prio_bits) } + }; let binds = &monotonic.args.binds; // Compile time assert that this priority is supported by the device |