Other Parts Discussed in Thread: C2000WARE
hello,
QUESTION: when usb CDC device interrupt program has been triggered and USB_EVENT_RX_AVAILABLE is obtained.
The return value of USBDCDCRxPacketAvailable(&g_sCDCDevice) has always been 0.
I'm sure get the data, because of i get the correct data by USBBufferRead(const tUSBBuffer *psBuffer, uint8_t *pui8Data, uint32_t ui32Length)
Please help analyze what went wrong. thank you.
{
{
//
// A new packet has been received.
//
case USB_EVENT_RX_AVAILABLE:
{
uint32_t rx_available = USBDCDCRxPacketAvailable(&g_sCDCDevice);
break;
}
{
return(0);
}
{
return(0);
}
// We don't expect to receive any other events. Ignore any that show
// up in a release build or hang in a debug build.
//
default:
#ifdef DEBUG
while(1);
#else
break;
#endif
}
}