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:
parent
68a75591f4
commit
3e4b51e09b
1 changed files with 6 additions and 0 deletions
|
@ -299,6 +299,12 @@ static int8_t CDC_Itf_Receive(uint8_t* Buf, uint32_t *Len)
|
||||||
{
|
{
|
||||||
rxAvailable = *Len;
|
rxAvailable = *Len;
|
||||||
rxBuffPtr = Buf;
|
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);
|
return (USBD_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue