Fixed Low Speed USB devices broken when using the library HID Class driver (thanks...
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 23 Mar 2013 12:01:25 +0000 (12:01 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 23 Mar 2013 12:01:25 +0000 (12:01 +0000)
LUFA/DoxygenPages/ChangeLog.txt
LUFA/Drivers/USB/Class/Device/HIDClassDevice.c

index 09b1c36..cd4310a 100644 (file)
@@ -17,6 +17,8 @@
   *   - Updated the BUILD build system module to produce binary BIN files in addition to Intel HEX files
   *
   *  <b>Fixed:</b>
+  *  - Core:
+  *   - Fixed Low Speed USB devices broken when using the library HID Class driver (thanks to Michael)
   *  - Library Applications:
   *   - Added handler for SCSI_CMD_START_STOP_UNIT in demos using the Mass Storage class, to prevent ejection errors on *nix systems due to an
   *     unknown SCSI command
index f6b6659..6ca4c1f 100644 (file)
@@ -144,8 +144,8 @@ bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* const HIDInterfac
        HIDInterfaceInfo->Config.ReportINEndpoint.Type = EP_TYPE_INTERRUPT;
 
        if (!(Endpoint_ConfigureEndpointTable(&HIDInterfaceInfo->Config.ReportINEndpoint, 1)))
-         return false; 
-       
+         return false;
+
        return true;
 }
 
@@ -155,8 +155,15 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
          return;
 
        if (HIDInterfaceInfo->State.PrevFrameNum == USB_Device_GetFrameNumber())
-         return;
-         
+       {
+               #if defined(USB_DEVICE_OPT_LOWSPEED)
+               if (!(USB_Options & USB_DEVICE_OPT_LOWSPEED))
+                 return;
+               #else
+               return;
+               #endif
+       }
+
        Endpoint_SelectEndpoint(HIDInterfaceInfo->Config.ReportINEndpoint.Address);
 
        if (Endpoint_IsReadWriteAllowed())
@@ -191,7 +198,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
 
                        Endpoint_ClearIN();
                }
-               
+
                HIDInterfaceInfo->State.PrevFrameNum = USB_Device_GetFrameNumber();
        }
 }