Skip to content

Commit d5f85a6

Browse files
committed
Fix packets not being padded to a multiple of 4
1 parent a0daabd commit d5f85a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wifi.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ void Wifi::receivePackets()
233233

234234
void Wifi::transmitPacket(int index)
235235
{
236+
// Get the packet address and size, padded to a multiple of 4
236237
uint16_t address = (wTxbufLoc[index] & 0xFFF) << 1;
237-
uint16_t size = core->memory.read<uint16_t>(1, 0x4804000 + address + 0x0A) + 8;
238-
printf("Instance %d sending packet on channel %d with size 0x%X\n", core->id, index, size);
238+
uint16_t size = (core->memory.read<uint16_t>(1, 0x4804000 + address + 0x0A) + 11) & ~0x3;
239+
LOG("Instance %d sending packet on channel %d with size 0x%X\n", core->id, index, size);
239240

240241
// Start transmitting a packet
241242
sendInterrupt(7);

0 commit comments

Comments
 (0)