Fixed SPI driver not explicitly setting /SS and MISO pins as inputs when SPI_Init...
[pub/USBasp.git] / Demos / Host / LowLevel / KeyboardHostWithParser / KeyboardHostWithParser.c
index 666879c..15bc940 100644 (file)
@@ -194,9 +194,9 @@ void Keyboard_HID_Task(void)
                        {
                                HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
                                
-                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
-                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
-                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
 
                                /* 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"),
@@ -212,7 +212,7 @@ void Keyboard_HID_Task(void)
                        break;
                case HOST_STATE_Configured:
                        /* Select and unfreeze keyboard data pipe */
-                       Pipe_SelectPipe(KEYBOARD_DATAPIPE);     
+                       Pipe_SelectPipe(KEYBOARD_DATA_IN_PIPE); 
                        Pipe_Unfreeze();
 
                        /* Check to see if a packet has been received */
@@ -254,13 +254,13 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
                /* Create a temporary item pointer to the next report item */
                HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];
 
-               /* Check if the current report item is a keyboard scancode */
+               /* Check if the current report item is a keyboard scan-code */
                if ((ReportItem->Attributes.Usage.Page      == USAGE_PAGE_KEYBOARD) &&
                        (ReportItem->Attributes.BitSize         == 8)                   &&
                        (ReportItem->Attributes.Logical.Maximum > 1)                    &&
-                       (ReportItem->ItemType                   == REPORT_ITEM_TYPE_In))
+                       (ReportItem->ItemType                   == HID_REPORT_ITEM_In))
                {
-                       /* Retrieve the keyboard scancode from the report data retrieved from the device */
+                       /* Retrieve the keyboard scan-code from the report data retrieved from the device */
                        bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem);
                        
                        /* For multi-report devices - if the requested data was not in the issued report, continue */
@@ -270,7 +270,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
                        /* Key code is an unsigned char in length, cast to the appropriate type */
                        uint8_t KeyCode = (uint8_t)ReportItem->Value;
 
-                       /* If scancode is non-zero, a key is being pressed */
+                       /* If scan-code is non-zero, a key is being pressed */
                        if (KeyCode)
                        {
                                /* Toggle status LED to indicate keypress */
@@ -278,7 +278,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
 
                                char PressedKey = 0;
 
-                               /* Convert scancode to printable character if alphanumeric */
+                               /* Convert scan-code to printable character if alphanumeric */
                                if ((KeyCode >= 0x04) && (KeyCode <= 0x1D))
                                  PressedKey = (KeyCode - 0x04) + 'A';
                                else if ((KeyCode >= 0x1E) && (KeyCode <= 0x27))
@@ -293,7 +293,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
                                  putchar(PressedKey);
                        }
                        
-                       /* Once a scancode is found, stop scanning through the report items */
+                       /* Once a scan-code is found, stop scanning through the report items */
                        break;
                }
        }