diff options
| -rw-r--r-- | embassy-extras/src/peripheral.rs | 4 | ||||
| -rw-r--r-- | embassy-extras/src/peripheral_shared.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/v2/mod.rs | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/embassy-extras/src/peripheral.rs b/embassy-extras/src/peripheral.rs index e3e06d692..edc5fe955 100644 --- a/embassy-extras/src/peripheral.rs +++ b/embassy-extras/src/peripheral.rs | |||
| @@ -6,8 +6,8 @@ use core::ptr; | |||
| 6 | use embassy::interrupt::{Interrupt, InterruptExt}; | 6 | use embassy::interrupt::{Interrupt, InterruptExt}; |
| 7 | 7 | ||
| 8 | /// # Safety | 8 | /// # Safety |
| 9 | /// When types implementing this trait are used with `Peripheral` or `PeripheralMutex`, | 9 | /// When types implementing this trait are used with `PeripheralMutex`, |
| 10 | /// their lifetime must not end without first calling `Drop` on the `Peripheral` or `PeripheralMutex`. | 10 | /// no fields referenced by `on_interrupt`'s lifetimes must end without first calling `Drop` on the `PeripheralMutex`. |
| 11 | pub unsafe trait PeripheralStateUnchecked { | 11 | pub unsafe trait PeripheralStateUnchecked { |
| 12 | type Interrupt: Interrupt; | 12 | type Interrupt: Interrupt; |
| 13 | fn on_interrupt(&mut self); | 13 | fn on_interrupt(&mut self); |
diff --git a/embassy-extras/src/peripheral_shared.rs b/embassy-extras/src/peripheral_shared.rs index d05ae0307..820622bb9 100644 --- a/embassy-extras/src/peripheral_shared.rs +++ b/embassy-extras/src/peripheral_shared.rs | |||
| @@ -5,8 +5,8 @@ use core::ptr; | |||
| 5 | use embassy::interrupt::{Interrupt, InterruptExt}; | 5 | use embassy::interrupt::{Interrupt, InterruptExt}; |
| 6 | 6 | ||
| 7 | /// # Safety | 7 | /// # Safety |
| 8 | /// When types implementing this trait are used with `Peripheral` or `PeripheralMutex`, | 8 | /// When types implementing this trait are used with `Peripheral`, |
| 9 | /// their lifetime must not end without first calling `Drop` on the `Peripheral` or `PeripheralMutex`. | 9 | /// no fields referenced by `on_interrupt`'s lifetimes must end without first calling `Drop` on the `Peripheral`. |
| 10 | pub unsafe trait PeripheralStateUnchecked { | 10 | pub unsafe trait PeripheralStateUnchecked { |
| 11 | type Interrupt: Interrupt; | 11 | type Interrupt: Interrupt; |
| 12 | fn on_interrupt(&self); | 12 | fn on_interrupt(&self); |
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index a8a361dfe..c4be2bd2c 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -343,7 +343,8 @@ impl<'d, const TX: usize, const RX: usize> Inner<'d, TX, RX> { | |||
| 343 | } | 343 | } |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | impl<'d, const TX: usize, const RX: usize> PeripheralState for Inner<'d, TX, RX> { | 346 | // SAFETY: The lifetime of `Inner` is only due to `PhantomData`; it isn't actually referencing any data with that lifetime. |
| 347 | unsafe impl<'d, const TX: usize, const RX: usize> PeripheralStateUnchecked for Inner<'d, TX, RX> { | ||
| 347 | type Interrupt = crate::interrupt::ETH; | 348 | type Interrupt = crate::interrupt::ETH; |
| 348 | 349 | ||
| 349 | fn on_interrupt(&mut self) { | 350 | fn on_interrupt(&mut self) { |
