mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
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>
This commit is contained in:
commit
8940c50fa7
2 changed files with 6 additions and 2 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue