X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/7f9f97c792dee6875fbca9806422bdd7d6c5a657..c58c53dba90fdc19d38f5e5d6957f2ede2a740f3:/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c 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;