From 0fdc1a2bc66f97048b94b967e80cd294189fca62 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 1 Sep 2009 15:46:46 +0000 Subject: Changed HIDParser to only zero out important values in the Parsed HID Report Item Information structure to save cycles. --- LUFA/Drivers/USB/Class/Host/HIDParser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'LUFA/Drivers/USB') diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 3fbad6508..241e17a05 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -46,8 +46,13 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID #endif HID_CollectionPath_t* CurrCollectionPath = NULL; - memset(ParserData, 0x00, sizeof(HID_ReportInfo_t)); - memset(StateTable, 0x00, sizeof(StateTable)); + ParserData->TotalReportItems = 0; + ParserData->UsingMultipleReports = false; + + for (uint8_t CurrCollection = 0; CurrCollection < HID_MAX_COLLECTIONS; CurrCollection++) + ParserData->CollectionPaths[CurrCollection].Parent = NULL; + + memset(&StateTable[0], 0x00, sizeof(HID_StateTable_t)); while (ReportSize) { -- cgit v1.2.3