aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam Murphy <[email protected]>2021-07-05 18:18:05 +1000
committerLiam Murphy <[email protected]>2021-07-05 18:18:05 +1000
commitfc1ef4947d463495ccd3da1d7763dcbe95a2588f (patch)
tree41853c3a41a3fc22fb75b6db3177e08460add1b2
parent3d96b10b0cd0066d4269094852e458bbf80a9807 (diff)
Fix stm32 ethernet
-rw-r--r--embassy-extras/src/peripheral.rs4
-rw-r--r--embassy-extras/src/peripheral_shared.rs4
-rw-r--r--embassy-stm32/src/eth/v2/mod.rs3
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;
6use embassy::interrupt::{Interrupt, InterruptExt}; 6use 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`.
11pub unsafe trait PeripheralStateUnchecked { 11pub 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;
5use embassy::interrupt::{Interrupt, InterruptExt}; 5use 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`.
10pub unsafe trait PeripheralStateUnchecked { 10pub 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
346impl<'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.
347unsafe 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) {