diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-05-24 07:14:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-24 07:14:59 +0000 |
| commit | 5fe63502787baa740cb5d99d535044cf72f06d54 (patch) | |
| tree | ef7676d4fcad579efbbd2f8325bf68f0e9b06a14 /macros/src/codegen/pre_init.rs | |
| parent | 1a24c725d2c6889b68056f4804b588611271c1fd (diff) | |
| parent | b15bda2d39e708c23027264dfa1acd72deb0b59b (diff) | |
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.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index ae2fd05..3d541a4 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; |
