diff options
| author | Timo Kröger <[email protected]> | 2021-06-04 23:42:25 +0200 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2021-06-04 23:42:25 +0200 |
| commit | 628e58020f5515a7a31267e3ed3e915b507a962f (patch) | |
| tree | ca3858ef14173ccd91fe989a55a707e40c548014 | |
| parent | cd44b221ed558689a20090771228c703e56e3371 (diff) | |
Add `Unborrow` trait bound for `Interrupt`
Allows the compiler to figure out bounds for wrapper code of owned
peripherals and interrupts.
Example: https://gist.github.com/timokroeger/f025ef590557f1cd6c2e9c7ab30442d2
| -rw-r--r-- | embassy/src/interrupt.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy/src/interrupt.rs b/embassy/src/interrupt.rs index 99d7af753..df3a79ccc 100644 --- a/embassy/src/interrupt.rs +++ b/embassy/src/interrupt.rs | |||
| @@ -30,7 +30,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for NrWrap { | |||
| 30 | } | 30 | } |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | pub unsafe trait Interrupt { | 33 | pub unsafe trait Interrupt: crate::util::Unborrow<Target = Self> { |
| 34 | type Priority: From<u8> + Into<u8> + Copy; | 34 | type Priority: From<u8> + Into<u8> + Copy; |
| 35 | fn number(&self) -> u16; | 35 | fn number(&self) -> u16; |
| 36 | unsafe fn steal() -> Self; | 36 | unsafe fn steal() -> Self; |
