Implement PeripheralBorrow for interrupts.
This commit is contained in:
parent
9c4087ac5c
commit
d9aaa0edf8
1 changed files with 14 additions and 0 deletions
|
@ -137,6 +137,20 @@ pub fn interrupt_declare(item: TokenStream) -> TokenStream {
|
|||
&HANDLER
|
||||
}
|
||||
}
|
||||
|
||||
impl ::embassy::util::PeripheralBorrow for #name_interrupt {
|
||||
type Target = #name_interrupt;
|
||||
unsafe fn unborrow(self) -> #name_interrupt {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl ::embassy::util::PeripheralBorrow for &mut #name_interrupt {
|
||||
type Target = #name_interrupt;
|
||||
unsafe fn unborrow(self) -> #name_interrupt {
|
||||
::core::ptr::read(self)
|
||||
}
|
||||
}
|
||||
};
|
||||
result.into()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue