Merge pull request #26 from timokroeger/fix-irq-nr

Fix IRQ numbers
This commit is contained in:
Dario Nieuwenhuis 2021-01-17 18:52:43 +01:00 committed by GitHub
commit 28b5d8e9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,9 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
unsafe impl OwnedInterrupt for #name_interrupt { unsafe impl OwnedInterrupt for #name_interrupt {
type Priority = Priority; type Priority = Priority;
fn number(&self) -> u8 { fn number(&self) -> u8 {
Interrupt::#name as u8 use cortex_m::interrupt::Nr;
let irq = Interrupt::#name;
irq.nr() as u8
} }
unsafe fn __handler(&self) -> &'static ::embassy::interrupt::Handler { unsafe fn __handler(&self) -> &'static ::embassy::interrupt::Handler {
#[export_name = #name_handler] #[export_name = #name_handler]