Not finding much on this but I have something working with strange results.
some examples are
actual data sniffed a,1,1,1 but data seen a,1,3,0
actual data sniffed 5,1,ff,0Â but data seen
5,1,ff,0Â
actual data sniffed 2,1,ff,
ff
Â
never seen
actual data sniffed 1,1,15,0Â
never seen
I think maybe I need a wait loop, but unsure how that works.
void HID_Task(void)//Function to manage HID report generation and transmission to the host. Â
{
   //Device must be connected and configured for the task to run
   if (USB_DeviceState != DEVICE_STATE_Configured)
    return;
Â
      Endpoint_SelectEndpoint(EPNUM2);
      if (Endpoint_IsOUTReceived())//we received something on the OUT endpoint.
      {
         if (Endpoint_IsReadWriteAllowed())// packet has data, react to it.
         {     Â
            uint8_t GenericData[64];   // temporary buffer
            uint8_t out_wait_report_bytes = 0;
            Endpoint_Read_Stream_LE(&GenericData, sizeof(GenericData), NULL);// Read in to buffer
            FfbProcessor(OutReportSize[ GenericData[0] -1 ], &GenericData);
         }
         Endpoint_ClearOUT();//acknowledge an OUT packet on this endpoint.
      }
 Â
}