eth-v2: Fix off by one bug

This commit is contained in:
Thales Fragoso 2021-06-11 02:57:28 -03:00 committed by Dario Nieuwenhuis
parent 54ad2a41f1
commit 0b42e12604

View File

@ -340,7 +340,7 @@ impl<const N: usize> RDesRing<N> {
unsafe {
ETH.ethernet_dma()
.dmacrx_dtpr()
.write(|w| w.set_rdt(&self.rd[self.read_idx] as *const _ as u32));
.write(|w| w.set_rdt(&self.rd[self.tail_idx] as *const _ as u32));
}
self.tail_idx = (self.tail_idx + 1) % N;