Added new ReportType parameter to the HID Device Class driver CALLBACK_HID_Device_CreateHIDReport() callback to indicate the report type to generate.

This commit is contained in:
Dean Camera 2009-11-23 13:22:33 +00:00
parent c438d01f87
commit 8b009bc113
23 changed files with 36 additions and 24 deletions

View file

@ -50,10 +50,11 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
uint16_t ReportINSize = 0;
uint8_t ReportID = (USB_ControlRequest.wValue & 0xFF);
uint8_t ReportType = (USB_ControlRequest.wValue >> 8) - 1;
memset(HIDInterfaceInfo->Config.PrevReportINBuffer, 0, HIDInterfaceInfo->Config.PrevReportINBufferSize);
CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID,
CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportType,
HIDInterfaceInfo->Config.PrevReportINBuffer, &ReportINSize);
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
@ -158,7 +159,8 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
memset(ReportINData, 0, sizeof(ReportINData));
bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportINData, &ReportINSize);
bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, REPORT_ITEM_TYPE_In,
ReportINData, &ReportINSize);
bool StatesChanged = false;
bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining));