1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Merge pull request #9789 from etracer65/hal_vcp_64byte_receive_fix

This commit is contained in:
Michael Keller 2020-05-14 02:12:02 +12:00 committed by mikeller
parent 68a75591f4
commit 3e4b51e09b

View file

@ -299,6 +299,12 @@ static int8_t CDC_Itf_Receive(uint8_t* Buf, uint32_t *Len)
{
rxAvailable = *Len;
rxBuffPtr = Buf;
if (!rxAvailable) {
// Received an empty packet, trigger receiving the next packet.
// This will happen after a packet that's exactly 64 bytes is received.
// The USB protocol requires that an empty (0 byte) packet immediately follow.
USBD_CDC_ReceivePacket(&USBD_Device);
}
return (USBD_OK);
}