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 {
|
let priority = match priority {
|
||||||
Some(priority) => {
|
Some(ref priority) => quote::quote!( {
|
||||||
quote::quote!( #priority )
|
const {
|
||||||
}
|
core::assert!(
|
||||||
_ => {
|
!matches!(#priority, #root::interrupt::Priority::None),
|
||||||
quote::quote! { #root::interrupt::Priority::min() }
|
"Priority::None is not supported",
|
||||||
}
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
#priority
|
||||||
|
} ),
|
||||||
|
_ => quote::quote! { #root::interrupt::Priority::min() },
|
||||||
};
|
};
|
||||||
|
|
||||||
// XXX should we blacklist other attributes?
|
// XXX should we blacklist other attributes?
|
||||||
@ -115,15 +120,6 @@ pub fn handler(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||||||
quote::quote_spanned!(original_span =>
|
quote::quote_spanned!(original_span =>
|
||||||
#f
|
#f
|
||||||
|
|
||||||
const _: () = {
|
|
||||||
core::assert!(
|
|
||||||
match #priority {
|
|
||||||
#root::interrupt::Priority::None => false,
|
|
||||||
_ => true,
|
|
||||||
},
|
|
||||||
"Priority::None is not supported");
|
|
||||||
};
|
|
||||||
|
|
||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
#vis const #orig: #root::interrupt::InterruptHandler = #root::interrupt::InterruptHandler::new(#new, #priority);
|
#vis const #orig: #root::interrupt::InterruptHandler = #root::interrupt::InterruptHandler::new(#new, #priority);
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user