X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/242303c1607fca405d9407b9fab6fb78cae676e2..cf610c5c91c3eee02dec7ca848acc8da831ad98a:/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index d89807461..c00946247 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -58,7 +58,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = /** Main program entry point. This routine configures the hardware required by the application, then - * starts the scheduler to run the application tasks. + * enters a loop to run the application tasks in sequence. */ int main(void) { @@ -104,9 +104,9 @@ int main(void) break; } - if (USB_HID_Host_SetReportProtocol(&Keyboard_HID_Interface) != 0) + if (HID_Host_SetReportProtocol(&Keyboard_HID_Interface) != 0) { - printf("Could not Set Report Protocol Mode.\r\n"); + printf("Error Setting Report Protocol Mode or Not a Valid Keyboard.\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; @@ -114,7 +114,7 @@ int main(void) LEDs_SetAllLEDs(LEDS_NO_LEDS); - printf("HID Device Enumerated.\r\n"); + printf("Keyboard Enumerated.\r\n"); USB_HostState = HOST_STATE_Configured; break; case HOST_STATE_Configured: @@ -251,20 +251,15 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8 * we aren't interested in (preventing us from being able to extract them later on, but saving on the RAM they would * have occupied). * - * \param CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with + * \param[in] CurrentItemAttributes Pointer to the attrbutes of the item the HID report parser is currently working with * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_Attributes_t* CurrentItemAttributes) { - /* Check the attributes of the current item - see if we are interested in it or not */ - if (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD) - { - /* Only store KEYBOARD usage page items into the Processed HID Report structure to save RAM */ - return true; - } - else - { - return false; - } + /* Check the attributes of the current item - see if we are interested in it or not; + * only store KEYBOARD usage page items into the Processed HID Report structure to + * save RAM and ignore the rest + */ + return (CurrentItemAttributes->Usage.Page == USAGE_PAGE_KEYBOARD); }