diff options
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host')
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/HIDParser.c | 13 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/HIDParser.h | 18 |
2 files changed, 20 insertions, 11 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 7ec003f27..fdce8e577 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -81,8 +81,8 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1])
return HID_PARSE_HIDStackOverflow;
- memcpy(CurrStateTable,
- (CurrStateTable + 1),
+ memcpy((CurrStateTable + 1),
+ CurrStateTable,
sizeof(HID_ReportItem_t));
CurrStateTable++;
@@ -122,8 +122,13 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID break;
case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
CurrStateTable->ReportID = ReportItemData;
- BitOffsetIn = 0;
- BitOffsetOut = 0;
+ ParserData->UsingMultipleReports = true;
+ BitOffsetIn = 0;
+ BitOffsetOut = 0;
+
+ #if defined(HID_ENABLE_FEATURE_PROCESSING)
+ BitOffsetFeature = 0;
+ #endif
break;
case (TYPE_LOCAL | TAG_LOCAL_USAGE):
if (UsageStackSize == HID_USAGE_STACK_DEPTH)
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h index a9fff3ea2..942fe1177 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h @@ -201,13 +201,17 @@ typedef struct
{
uint8_t TotalReportItems; /**< Total number of report items stored in the
- * ReportItems array. */
-
+ * ReportItems array.
+ */
HID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS]; /**< Report items array, including
- * all IN, OUT and FEATURE items. */
-
+ * all IN, OUT and FEATURE items.
+ */
HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]; /**< All collection items, referenced
- * by the report items. */
+ * by the report items.
+ */
+ bool UsingMultipleReports; /**< Indicates if the device has at least one REPORT ID
+ * element in its HID report descriptor.
+ */
} HID_ReportInfo_t;
/* Function Prototypes: */
@@ -239,9 +243,9 @@ * buffer. The report buffer is assumed to have the appropriate bits cleared before calling
* this function (i.e., the buffer should be explicitly cleared before report values are added).
*
- * If the device has multiple HID reports, the report ID is set to the report ID of the given item.
+ * If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.
*
- * \param[out] ReportData Buffer holding the current OUT report data
+ * \param[out] ReportData Buffer holding the current OUT or FEATURE report data
* \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array
*/
void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)
|