Ensure that the CDC class drivers return 0 if the number of unread bytes is queried and the bank has become empty.
This commit is contained in:
parent
c3db72afdc
commit
cde2afc50e
3 changed files with 19 additions and 10 deletions
|
@ -195,9 +195,14 @@ uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterface
|
|||
if (Endpoint_IsOUTReceived())
|
||||
{
|
||||
if (!(Endpoint_BytesInEndpoint()))
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
return Endpoint_BytesInEndpoint();
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Endpoint_BytesInEndpoint();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue