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