Added incomplete MIDIToneGenerator project.
[pub/USBasp.git] / Demos / Host / ClassDriver / KeyboardHostWithParser / KeyboardHostWithParser.c
index 8fe3ede..78ec56a 100644 (file)
@@ -130,18 +130,16 @@ int main(void)
                                        {\r
                                                HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];\r
 \r
-                                               /* Check if the current report item is a keyboard scancode */\r
+                                               /* Update the report item value if it is contained within the current report */\r
+                                               if (!(USB_GetHIDReportItemInfo(KeyboardReport, ReportItem)))\r
+                                                 continue;\r
+\r
+                                               /* Determine what report item is being tested, process updated value as needed */\r
                                                if ((ReportItem->Attributes.Usage.Page      == USAGE_PAGE_KEYBOARD) &&\r
                                                        (ReportItem->Attributes.BitSize         == 8)                   &&\r
                                                        (ReportItem->Attributes.Logical.Maximum > 1)                    &&\r
                                                        (ReportItem->ItemType                   == REPORT_ITEM_TYPE_In))\r
                                                {\r
-                                                       /* Retrieve the keyboard scancode from the report data retrieved from the device if it is\r
-                                                        * contained within the current report, if not, skip to the next item in the parser list\r
-                                                        */\r
-                                                       if (!(USB_GetHIDReportItemInfo(KeyboardReport, ReportItem)))\r
-                                                         continue;\r
-\r
                                                        /* Key code is an unsigned char in length, cast to the appropriate type */\r
                                                        uint8_t KeyCode = (uint8_t)ReportItem->Value;\r
 \r