Skip to content

Commit bbd3ae2

Browse files
authored
Merge pull request #4864 from sandeepmistry/avr-usb-tx
Subtract one from USB_EP_SIZE in USB_SendSpace
2 parents cc6dfd2 + 817d700 commit bbd3ae2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hardware/arduino/avr/cores/arduino/USBCore.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ u8 USB_SendSpace(u8 ep)
255255
LockEP lock(ep);
256256
if (!ReadWriteAllowed())
257257
return 0;
258-
return USB_EP_SIZE - FifoByteCount();
258+
// subtract 1 from the EP size to never send a full packet,
259+
// this avoids dealing with ZLP's in USB_Send
260+
return USB_EP_SIZE - 1 - FifoByteCount();
259261
}
260262

261263
// Blocking Send of data to an endpoint

0 commit comments

Comments
 (0)