Fix stm32 ethernet

This commit is contained in:
Liam Murphy 2021-07-05 18:18:05 +10:00
parent 3d96b10b0c
commit fc1ef4947d
3 changed files with 6 additions and 5 deletions

View File

@ -6,8 +6,8 @@ use core::ptr;
use embassy::interrupt::{Interrupt, InterruptExt}; use embassy::interrupt::{Interrupt, InterruptExt};
/// # Safety /// # Safety
/// When types implementing this trait are used with `Peripheral` or `PeripheralMutex`, /// When types implementing this trait are used with `PeripheralMutex`,
/// their lifetime must not end without first calling `Drop` on the `Peripheral` or `PeripheralMutex`. /// no fields referenced by `on_interrupt`'s lifetimes must end without first calling `Drop` on the `PeripheralMutex`.
pub unsafe trait PeripheralStateUnchecked { pub unsafe trait PeripheralStateUnchecked {
type Interrupt: Interrupt; type Interrupt: Interrupt;
fn on_interrupt(&mut self); fn on_interrupt(&mut self);

View File

@ -5,8 +5,8 @@ use core::ptr;
use embassy::interrupt::{Interrupt, InterruptExt}; use embassy::interrupt::{Interrupt, InterruptExt};
/// # Safety /// # Safety
/// When types implementing this trait are used with `Peripheral` or `PeripheralMutex`, /// When types implementing this trait are used with `Peripheral`,
/// their lifetime must not end without first calling `Drop` on the `Peripheral` or `PeripheralMutex`. /// no fields referenced by `on_interrupt`'s lifetimes must end without first calling `Drop` on the `Peripheral`.
pub unsafe trait PeripheralStateUnchecked { pub unsafe trait PeripheralStateUnchecked {
type Interrupt: Interrupt; type Interrupt: Interrupt;
fn on_interrupt(&self); fn on_interrupt(&self);

View File

@ -343,7 +343,8 @@ impl<'d, const TX: usize, const RX: usize> Inner<'d, TX, RX> {
} }
} }
impl<'d, const TX: usize, const RX: usize> PeripheralState for Inner<'d, TX, RX> { // SAFETY: The lifetime of `Inner` is only due to `PhantomData`; it isn't actually referencing any data with that lifetime.
unsafe impl<'d, const TX: usize, const RX: usize> PeripheralStateUnchecked for Inner<'d, TX, RX> {
type Interrupt = crate::interrupt::ETH; type Interrupt = crate::interrupt::ETH;
fn on_interrupt(&mut self) { fn on_interrupt(&mut self) {