diff options
author | Arturo Guadalupi <a.guadalupi@arduino.cc> | 2016-07-11 18:02:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-11 18:02:38 +0200 |
commit | 2717fbe05bf6341dd79acebdfccc9ffd5e2b1223 (patch) | |
tree | 8e46c37b00c65b6f992cd7275c9f4316d9605011 /cores/arduino | |
parent | 2a10caa4fcc30c08809cce3827225932d55b5de1 (diff) | |
parent | 5e3d08af24b6254cf5308b2a1c19491bcc92c608 (diff) |
Merge pull request #4864 from sandeepmistry/avr-usb-tx
Subtract one from USB_EP_SIZE in USB_SendSpace
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/USBCore.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index 3c7da86..44dce72 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -255,7 +255,9 @@ u8 USB_SendSpace(u8 ep) LockEP lock(ep); if (!ReadWriteAllowed()) return 0; - return USB_EP_SIZE - FifoByteCount(); + // subtract 1 from the EP size to never send a full packet, + // this avoids dealing with ZLP's in USB_Send + return USB_EP_SIZE - 1 - FifoByteCount(); } // Blocking Send of data to an endpoint |