aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-09-27 13:31:19 +0000
committerGitHub <noreply@github.com>2021-09-27 13:31:19 +0000
commit8940c50fa739f47045ce45b23422645bf4922538 (patch)
tree853b52e0ecb1836ffe0083a9a00ea74abfeab105
parent58a492057654610055b2cad08a227e0b76a57a77 (diff)
parent9a0d27a91e83cfd2847c9f389bb92695f384c66c (diff)
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>
-rw-r--r--macros/Cargo.toml2
-rw-r--r--macros/src/codegen/pre_init.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 56bfd5c..de860b1 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -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"
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs
index 69f16fe..eb216d8 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