diff options
-rw-r--r-- | src/Wifi.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Wifi.cpp b/src/Wifi.cpp index e00f72b..6792bc8 100644 --- a/src/Wifi.cpp +++ b/src/Wifi.cpp @@ -793,13 +793,12 @@ bool ProcessTX(TXSlot* slot, int num) inline void IncrementRXAddr(u16& addr, u16 inc = 2) { - addr += inc; - addr &= 0x1FFE; - if (addr >= (IOPORT(W_RXBufEnd) & 0x1FFE)) + for (u32 i = 0; i < inc; i += 2) { - addr -= (IOPORT(W_RXBufEnd) & 0x1FFE); - addr += (IOPORT(W_RXBufBegin) & 0x1FFE); + addr += 2; addr &= 0x1FFE; + if (addr == (IOPORT(W_RXBufEnd) & 0x1FFE)) + addr = (IOPORT(W_RXBufBegin) & 0x1FFE); } } |