Change HID report parser so that it can calculate and record the sizes (IN, OUT and...
[pub/USBasp.git] / Demos / Host / LowLevel / KeyboardHostWithParser / KeyboardHostWithParser.c
index 3c9f304..3e6aa28 100644 (file)
@@ -182,6 +182,20 @@ void Keyboard_HID_Task(void)
                                break;  \r
                        }\r
 \r
+                       printf("Total Reports: %d\r\n", HIDReportInfo.TotalDeviceReports);\r
+\r
+                       for (uint8_t i = 0; i < HIDReportInfo.TotalDeviceReports; i++)\r
+                       {\r
+                               HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];\r
+                               \r
+                               /* Print out the byte sizes of each report within the device */\r
+                               printf_P(PSTR("  + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),\r
+                                                          CurrReportIDInfo->ReportID,\r
+                                                          ((CurrReportIDInfo->BitsIn >> 3)      + (CurrReportIDInfo->BitsIn & 0x07)),\r
+                                                          ((CurrReportIDInfo->BitsOut >> 3)     + (CurrReportIDInfo->BitsOut & 0x07)),\r
+                                                          ((CurrReportIDInfo->BitsFeature >> 3) + (CurrReportIDInfo->BitsFeature & 0x07)));\r
+                       }\r
+\r
                        puts_P(PSTR("Keyboard Enumerated.\r\n"));\r
 \r
                        USB_HostState = HOST_STATE_Configured;\r