Changed HIDParser to only zero out important values in the Parsed HID Report Item...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 1 Sep 2009 15:46:46 +0000 (15:46 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 1 Sep 2009 15:46:46 +0000 (15:46 +0000)
LUFA/Drivers/USB/Class/Host/HIDParser.c
LUFA/ManPages/ChangeLog.txt

index 3fbad65..241e17a 100644 (file)
@@ -46,8 +46,13 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID
 #endif\r
        HID_CollectionPath_t* CurrCollectionPath  = NULL;\r
 \r
-       memset(ParserData, 0x00, sizeof(HID_ReportInfo_t));\r
-       memset(StateTable, 0x00, sizeof(StateTable));\r
+       ParserData->TotalReportItems     = 0;\r
+       ParserData->UsingMultipleReports = false;\r
+       \r
+       for (uint8_t CurrCollection = 0; CurrCollection < HID_MAX_COLLECTIONS; CurrCollection++)\r
+         ParserData->CollectionPaths[CurrCollection].Parent = NULL;\r
+\r
+       memset(&StateTable[0], 0x00, sizeof(HID_StateTable_t));\r
 \r
        while (ReportSize)\r
        {\r
index d62a31c..d42ad45 100644 (file)
@@ -31,6 +31,7 @@
   *  - Altered the SCSI commands in the LowLevel Mass Storage Host to save on FLASH space by reducing function calls\r
   *  - Changed the parameters and behaviour of the USB_GetDeviceConfigDescriptor() function so that it now performs size checks\r
   *    and data validations internally, to simplify user code\r
+  *  - Changed HIDParser to only zero out important values in the Parsed HID Report Item Information structure to save cycles\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the\r