aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/pre_init.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2022-05-24 07:14:59 +0000
committerGravatar GitHub <noreply@github.com> 2022-05-24 07:14:59 +0000
commit5fe63502787baa740cb5d99d535044cf72f06d54 (patch)
treeef7676d4fcad579efbbd2f8325bf68f0e9b06a14 /macros/src/codegen/pre_init.rs
parent1a24c725d2c6889b68056f4804b588611271c1fd (diff)
parentb15bda2d39e708c23027264dfa1acd72deb0b59b (diff)
downloadrtic-5fe63502787baa740cb5d99d535044cf72f06d54.tar.gz
rtic-5fe63502787baa740cb5d99d535044cf72f06d54.tar.zst
rtic-5fe63502787baa740cb5d99d535044cf72f06d54.zip
Merge #643
643: Fix clash with defmt r=AfoHT a=korken89 Fixes #642 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'macros/src/codegen/pre_init.rs')
-rw-r--r--macros/src/codegen/pre_init.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs
index ae2fd050..3d541a47 100644
--- a/macros/src/codegen/pre_init.rs
+++ b/macros/src/codegen/pre_init.rs
@@ -55,7 +55,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
);
// Compile time assert that this priority is supported by the device
stmts.push(quote!(
- const _: () = assert!((1 << #nvic_prio_bits) >= #priority as usize, #es);
+ const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); };
));
stmts.push(quote!(
@@ -84,7 +84,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
);
// Compile time assert that this priority is supported by the device
stmts.push(quote!(
- const _: () = assert!((1 << #nvic_prio_bits) >= #priority as usize, #es);
+ const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); };
));
stmts.push(quote!(core.SCB.set_priority(
@@ -109,7 +109,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
);
// Compile time assert that this priority is supported by the device
stmts.push(quote!(
- const _: () = assert!((1 << #nvic_prio_bits) >= #priority as usize, #es);
+ const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); };
));
let mono_type = &monotonic.ty;