diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2022-05-24 05:51:44 +0200 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2022-05-24 08:31:31 +0200 |
| commit | b15bda2d39e708c23027264dfa1acd72deb0b59b (patch) | |
| tree | ef7676d4fcad579efbbd2f8325bf68f0e9b06a14 /macros/src/codegen/pre_init.rs | |
| parent | 1a24c725d2c6889b68056f4804b588611271c1fd (diff) | |
Fix clash with defmt
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; |
