micropython-lib/micropython/usb/usb-device-cdc
Angus Gratton 0a91a37563 usb-device-cdc: Fix lost data in read() path if short reads happened.
If the CDC receive buffer was full and some code read less than 64 bytes
(wMaxTransferSize), the CDC code would submit an OUT transfer with N<64
bytes length to fill the buffer back up.

However if the host had more than N bytes to send then it would still send
the full 64 bytes (correctly) in the transfer. The remaining (64-N) bytes
would be lost.

Adds the restriction that CDCInterface rxbuf has to be at least 64 bytes.

Fixes issue #885.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-07-03 17:17:38 +10:00
..
usb/device usb-device-cdc: Fix lost data in read() path if short reads happened. 2024-07-03 17:17:38 +10:00
manifest.py usb-device-cdc: Fix lost data in read() path if short reads happened. 2024-07-03 17:17:38 +10:00