Add Priority enums to embassy-extras

This commit is contained in:
Dario Nieuwenhuis
2021-05-01 03:05:21 +02:00
parent 005528eb8d
commit 71cf742621
3 changed files with 574 additions and 2 deletions

View File

@ -131,10 +131,10 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
#[allow(non_camel_case_types)]
pub struct #name_interrupt(());
unsafe impl Interrupt for #name_interrupt {
type Priority = crate::interrupt::Priority;
type Priority = Priority;
fn number(&self) -> u16 {
use cortex_m::interrupt::InterruptNumber;
let irq = crate::pac::Interrupt::#name;
let irq = InterruptEnum::#name;
irq.number() as u16
}
unsafe fn steal() -> Self {