Event Driven USB Task
Posted: Wed Mar 22, 2017 8:54 pm
Hi,
I am having difficulty implementing an event driven USB Task. I have ported the code from AN00136_vendor_specific, it works ok but is not suited for our application since it goes in a loop polling to see if there is data and then replies to PC.
I need to do something like this:
I have tried using XUD_GetDataSelect(c_epOut, ep_out, len, rslt), but it returns immediately and the DSP is not enumerating. Using XUD_GetBuffer(..) helps with the enumeration problem, but it does not help with the overall code architecture.
Is there a way to "select" on USB data available?
Thanks!
-Saul
I am having difficulty implementing an event driven USB Task. I have ported the code from AN00136_vendor_specific, it works ok but is not suited for our application since it goes in a loop polling to see if there is data and then replies to PC.
I need to do something like this:
Code: Select all
void CommsTask(.. USB channels, some interfaces to movable pointers)
{
USB Endpoints and buffer setup
while(1)
{
select
{
onUsbDataReceive():
Notify other task of received USB data()
break;
onProcessedDataReady():
Send Data To Host via USB()
break;
}
}
Is there a way to "select" on USB data available?
Thanks!
-Saul