Skip to content

Commit f98d0e0

Browse files
committed
Fix smoltcp-phy
1 parent 3c22676 commit f98d0e0

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

examples/ip.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,5 @@ fn ETH() {
156156
*eth_pending = true;
157157
});
158158

159-
// Clear interrupt flags
160-
let p = unsafe { Peripherals::steal() };
161-
stm32_eth::eth_interrupt_handler(&p.ETHERNET_DMA);
159+
stm32_eth::eth_interrupt_handler();
162160
}

examples/rtic-echo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ mod app {
5858
}
5959

6060
#[init(local = [
61-
rx_ring: [RxRingEntry; 2] = [RxRingEntry::new(),RxRingEntry::new()],
62-
tx_ring: [TxRingEntry; 2] = [TxRingEntry::new(),TxRingEntry::new()],
61+
rx_ring: [RxRingEntry; 2] = [RxRingEntry::new(), RxRingEntry::new()],
62+
tx_ring: [TxRingEntry; 2] = [TxRingEntry::new(), TxRingEntry::new()],
6363
rx_storage: [u8; 512] = [0u8; 512],
6464
tx_storage: [u8; 512] = [0u8; 512],
6565
socket_storage: [SocketStorage<'static>; 1] = [SocketStorage::EMPTY; 1],
@@ -179,7 +179,7 @@ mod app {
179179
cx.local.dma,
180180
);
181181

182-
let interrupt_reason = dma.interrupt_handler();
182+
let interrupt_reason = stm32_eth::eth_interrupt_handler();
183183
defmt::debug!("Got an ethernet interrupt! Reason: {}", interrupt_reason);
184184

185185
iface.poll(now_fn(), &mut dma, sockets);

src/dma/smoltcp_phy.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ impl<'dma, 'tx> TxToken for EthTxToken<'dma, 'tx> {
7474
{
7575
// NOTE(unwrap): an `EthTxToken` is only created if
7676
// there is a descriptor available for sending.
77-
self.tx_ring.send(len, None, f).ok().unwrap()
77+
let mut tx_packet = self.tx_ring.send_next(len, None).ok().unwrap();
78+
let res = f(&mut tx_packet);
79+
tx_packet.send();
80+
res
7881
}
7982
}

0 commit comments

Comments
 (0)