Fix HID_Host_SetIdlePeriod() function to send the correct request type to the device...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 5 Jul 2011 00:28:35 +0000 (00:28 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 5 Jul 2011 00:28:35 +0000 (00:28 +0000)
LUFA/Drivers/USB/Class/Host/HID.c
LUFA/Drivers/USB/Class/Host/HID.h

index 606b3df..94d09f3 100644 (file)
@@ -362,7 +362,7 @@ uint8_t HID_Host_SetIdlePeriod(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
 {
        USB_ControlRequest = (USB_Request_Header_t)
                {
-                       .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
+                       .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
                        .bRequest      = HID_REQ_SetIdle,
                        .wValue        = ((MS << 6) & 0xFF00),
                        .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
@@ -371,7 +371,7 @@ uint8_t HID_Host_SetIdlePeriod(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
 
        Pipe_SelectPipe(PIPE_CONTROLPIPE);
 
-       return USB_Host_SendControlRequest(HIDReportData);
+       return USB_Host_SendControlRequest(NULL);
 }
 
 #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
index b9d8f68..a0bef78 100644 (file)
                         *  \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
                         */
                        uint8_t HID_Host_SetIdlePeriod(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
-                                                      const uint16_t MS);
+                                                      const uint16_t MS) ATTR_NON_NULL_PTR_ARG(1);
 
                        #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
                        /** Switches the attached HID device's reporting protocol over to the standard Report protocol mode. This also retrieves