Updated codegen for the updated syntax (default monotonic priority)

This commit is contained in:
Emil Fresk 2021-09-21 17:00:16 +02:00
parent 380a20859c
commit 9a0d27a91e
2 changed files with 6 additions and 2 deletions

View file

@ -22,4 +22,4 @@ proc-macro2 = "1"
proc-macro-error = "1"
quote = "1"
syn = "1"
rtic-syntax = "0.5.0-alpha.4"
rtic-syntax = "0.5.0-rc.1"

View file

@ -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