\r
#include "HID.h"\r
\r
-void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
+void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
- if ((USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber) &&\r
- (USB_ControlRequest.bRequest != REQ_SetIdle))\r
- {\r
- return;\r
- }\r
+ if (USB_ControlRequest.wIndex != HIDInterfaceInfo->Config.InterfaceNumber)\r
+ return;\r
\r
switch (USB_ControlRequest.bRequest)\r
{\r
case REQ_SetIdle:\r
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- if ((USB_ControlRequest.wIndex == HIDInterfaceInfo->Config.InterfaceNumber) ||\r
- (USB_ControlRequest.wValue & 0xFF) == 0)\r
- {\r
- Endpoint_ClearSETUP();\r
+ Endpoint_ClearSETUP();\r
\r
- HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6);\r
+ HIDInterfaceInfo->State.IdleCount = ((USB_ControlRequest.wValue & 0xFF00) >> 6);\r
\r
- Endpoint_ClearStatusStage();\r
- }\r
+ Endpoint_ClearStatusStage();\r
}\r
\r
break;\r
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
{\r
memset(&HIDInterfaceInfo->State, 0x00, sizeof(HIDInterfaceInfo->State));\r
- HIDInterfaceInfo->State.IdleCount = 500;\r
HIDInterfaceInfo->State.UsingReportProtocol = true;\r
+ HIDInterfaceInfo->State.IdleCount = 500;\r
\r
if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->Config.ReportINEndpointNumber, EP_TYPE_INTERRUPT,\r
ENDPOINT_DIR_IN, HIDInterfaceInfo->Config.ReportINEndpointSize, ENDPOINT_BANK_SINGLE)))\r