@ -143,11 +143,11 @@ uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
Endpoint_SelectEndpoint ( CDCInterfaceInfo - > Config . DataINEndpointNumber ) ;
if ( ! ( Endpoint_IsReadWriteAllowed ( ) ) )
{
uint8_t ErrorCode ;
{
Endpoint_ClearIN ( ) ;
uint8_t ErrorCode ;
if ( ( ErrorCode = Endpoint_WaitUntilReady ( ) ) ! = ENDPOINT_READYWAIT_NoError )
return ErrorCode ;
}
@ -161,20 +161,26 @@ uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
if ( ( USB_DeviceState ! = DEVICE_STATE_Configured ) | | ! ( CDCInterfaceInfo - > State . LineEncoding . BaudRateBPS ) )
return ENDPOINT_READYWAIT_NoError ;
uint8_t ErrorCode ;
Endpoint_SelectEndpoint ( CDCInterfaceInfo - > Config . DataINEndpointNumber ) ;
if ( ! ( Endpoint_BytesInEndpoint ( ) ) )
return ENDPOINT_READYWAIT_NoError ;
bool BankFull = ! ( Endpoint_IsReadWriteAllowed ( ) ) ;
if ( Endpoint_BytesInEndpoint ( ) )
Endpoint_ClearIN ( ) ;
if ( BankFull )
{
uint8_t ErrorCode ;
Endpoint_ClearIN ( ) ;
if ( ( ErrorCode = Endpoint_WaitUntilReady ( ) ) ! = ENDPOINT_READYWAIT_NoError )
return ErrorCode ;
Endpoint_ClearIN ( ) ;
}
Endpoint_ClearIN ( ) ;
return Endpoint_WaitUntilReady ( ) ;
return ENDPOINT_READYWAIT_NoError ;
}
uint16_t CDC_Device_BytesReceived ( USB_ClassInfo_CDC_Device_t * const CDCInterfaceInfo )