aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/pre_init.rs
diff options
context:
space:
mode:
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;