aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/ClassDriver/KeyboardHostWithParser
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-09 12:30:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-09 12:30:51 +0000
commit35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755 (patch)
tree66d7ecb248071bca4f6159d783ba0970bf37caa1 /Demos/Host/ClassDriver/KeyboardHostWithParser
parent3ab0b3a027db2549bc024780d7787061705056f6 (diff)
downloadlufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.tar.gz
lufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.tar.bz2
lufa-35a0fe93848cc6e1a79d2e606a2e3f6a84ba5755.zip
Fixed USB_GetHIDReportSize() returning the number of bits in the specified report instead of bytes.
Moved the USB_GetHIDReportItemInfo() calls into the main report item passing loop in the *HostWithParser demos - it is fast enough not to effect performance, and avoids duplicate code. Make Webserver project report the LUFA version as part of the HTTP header.
Diffstat (limited to 'Demos/Host/ClassDriver/KeyboardHostWithParser')
-rw-r--r--Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
index 8fe3edefe..78ec56aa3 100644
--- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -130,18 +130,16 @@ int main(void)
{
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
- /* Check if the current report item is a keyboard scancode */
+ /* Update the report item value if it is contained within the current report */
+ if (!(USB_GetHIDReportItemInfo(KeyboardReport, ReportItem)))
+ continue;
+
+ /* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
(ReportItem->Attributes.BitSize == 8) &&
(ReportItem->Attributes.Logical.Maximum > 1) &&
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
{
- /* Retrieve the keyboard scancode from the report data retrieved from the device if it is
- * contained within the current report, if not, skip to the next item in the parser list
- */
- if (!(USB_GetHIDReportItemInfo(KeyboardReport, ReportItem)))
- continue;
-
/* Key code is an unsigned char in length, cast to the appropriate type */
uint8_t KeyCode = (uint8_t)ReportItem->Value;