aboutsummaryrefslogtreecommitdiff
path: root/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-09-09 08:34:24 +0000
committerDean Camera <[email protected]>2009-09-09 08:34:24 +0000
commit524decdeb3a0a4c7adbeb4af906556e7bc6dd77c (patch)
tree3d3e83df9e11a61b2710d334c82609b0f3c89b4d /Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
parent331929833da3e48ac9c43dce90487490d7a77af1 (diff)
downloadqmk_firmware-524decdeb3a0a4c7adbeb4af906556e7bc6dd77c.tar.gz
qmk_firmware-524decdeb3a0a4c7adbeb4af906556e7bc6dd77c.zip
Change HID report parser so that it can calculate and record the sizes (IN, OUT and FEATURE) of each report within the device, by report ID. This will be required in host mode, so that the host can determine how many bytes of data must be read in for each report.
Add to MouseHostWithParser and KeyboardHostWithParser demos to print out the report sizes when a valid device is connected.
Diffstat (limited to 'Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c')
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
index 3c9f304910..3e6aa28cb0 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -182,6 +182,20 @@ void Keyboard_HID_Task(void)
break;
}
+ printf("Total Reports: %d\r\n", HIDReportInfo.TotalDeviceReports);
+
+ for (uint8_t i = 0; i < HIDReportInfo.TotalDeviceReports; i++)
+ {
+ HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
+
+ /* Print out the byte sizes of each report within the device */
+ printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
+ CurrReportIDInfo->ReportID,
+ ((CurrReportIDInfo->BitsIn >> 3) + (CurrReportIDInfo->BitsIn & 0x07)),
+ ((CurrReportIDInfo->BitsOut >> 3) + (CurrReportIDInfo->BitsOut & 0x07)),
+ ((CurrReportIDInfo->BitsFeature >> 3) + (CurrReportIDInfo->BitsFeature & 0x07)));
+ }
+
puts_P(PSTR("Keyboard Enumerated.\r\n"));
USB_HostState = HOST_STATE_Configured;