Make HID device class driver reselect the correct endpoint after the user callbacks have fired.

This commit is contained in:
Dean Camera 2009-10-26 05:27:59 +00:00
parent de70f0f1cf
commit cf610c5c91
5 changed files with 6 additions and 2 deletions

View file

@ -56,6 +56,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID,
HIDInterfaceInfo->Config.PrevReportINBuffer, &ReportINSize);
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
Endpoint_Write_Control_Stream_LE(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportINSize);
Endpoint_ClearOUT();
}
@ -167,6 +168,8 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
{
HIDInterfaceInfo->State.IdleMSRemaining = HIDInterfaceInfo->State.IdleCount;
Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber);
if (ReportID)
Endpoint_Write_Byte(ReportID);