Using MDK-PRO, 4.74 (actually 5, with legacy pack). I am trying to make a custom generic BULK class. I followed the suggestions for implementing a custom OUT Pipe and it is working fine. For my IN pipe I am having partial success.
Does anyone know what callback or function I need to overload so that I can get a callback or an event flag to tell my code to write a buffer with USBD_WriteEP()?
I have tried making a simple class overload task like:
__task void USBD_RTX_EndPoint1 (void){ volatile U16 evt; for (;;) { os_evt_wait_or(0xFFFF, 0xFFFF); /* Wait for an Event */ evt = os_evt_get(); /* Get Event Flags */ CLS_BulkIn (); /* data to send to Host */ evt &= ~USB_EVT_IN; os_evt_clr(USB_EVT_IN,USBD_RTX_EPTask[2]); } } void CLS_BulkIn() { ..process data to make buffer to send... USBD_WriteEP(0x81,thebuffer,thecount); }
but to no avail, this never gets an event. If I push data into the endpoint blindly, then the host will pick it up, however, I am trying to push data in response to an IN phase on the bus. Hopefully, -Steve