mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 12:20:56 +00:00
Don't check default priority (#3693)
This commit is contained in:
parent
99042a7d60
commit
d91806197d
@ -65,12 +65,17 @@ pub fn handler(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
);
|
||||
|
||||
let priority = match priority {
|
||||
Some(priority) => {
|
||||
quote::quote!( #priority )
|
||||
}
|
||||
_ => {
|
||||
quote::quote! { #root::interrupt::Priority::min() }
|
||||
}
|
||||
Some(ref priority) => quote::quote!( {
|
||||
const {
|
||||
core::assert!(
|
||||
!matches!(#priority, #root::interrupt::Priority::None),
|
||||
"Priority::None is not supported",
|
||||
);
|
||||
};
|
||||
|
||||
#priority
|
||||
} ),
|
||||
_ => quote::quote! { #root::interrupt::Priority::min() },
|
||||
};
|
||||
|
||||
// XXX should we blacklist other attributes?
|
||||
@ -115,15 +120,6 @@ pub fn handler(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
quote::quote_spanned!(original_span =>
|
||||
#f
|
||||
|
||||
const _: () = {
|
||||
core::assert!(
|
||||
match #priority {
|
||||
#root::interrupt::Priority::None => false,
|
||||
_ => true,
|
||||
},
|
||||
"Priority::None is not supported");
|
||||
};
|
||||
|
||||
#[allow(non_upper_case_globals)]
|
||||
#vis const #orig: #root::interrupt::InterruptHandler = #root::interrupt::InterruptHandler::new(#new, #priority);
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user