Be doubly-certain that the incomming CDC class driver's endpoint/pipe is flushed only once when the bank is empty.

This commit is contained in:
Dean Camera 2010-01-28 06:37:26 +00:00
parent cec699ac59
commit d26a9ed5fd
2 changed files with 26 additions and 10 deletions

View file

@ -190,10 +190,17 @@ uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterface
Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);
if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
if (Endpoint_IsOUTReceived())
{
if (!(Endpoint_BytesInEndpoint()))
Endpoint_ClearOUT();
return Endpoint_BytesInEndpoint();
return Endpoint_BytesInEndpoint();
}
else
{
return 0;
}
}
uint8_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)