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>
This commit is contained in:
bors[bot] 2021-09-27 13:31:19 +00:00 committed by GitHub
commit 8940c50fa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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