diff options
author | Dean Camera <[email protected]> | 2009-09-22 08:07:48 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2009-09-22 08:07:48 +0000 |
commit | 849b9535e7f4ca84aa909cfb9e985ae29f14be72 (patch) | |
tree | e111d99889ec320913fcfb3ff9c695dc31c740b4 /Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c | |
parent | 576f40f5aec3d7e48ed949fd24494b6cfb3ec93f (diff) | |
download | qmk_firmware-849b9535e7f4ca84aa909cfb9e985ae29f14be72.tar.gz qmk_firmware-849b9535e7f4ca84aa909cfb9e985ae29f14be72.zip |
Add new error condition to the HID Report Parser for when a report is parsed but no unfiltered items are encountered (i.e. nothing of interest in the device report). Make all host HID "WithParser" demos print the new error condition.
Diffstat (limited to 'Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c')
-rw-r--r-- | Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index 3b97ad7ed7..0cba5fccde 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -172,7 +172,11 @@ void Keyboard_HID_Task(void) if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)
{
puts_P(PSTR(ESC_FG_RED "Report Parse Error.\r\n"));
- printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
+
+ if (!(HIDReportInfo->TotalReportItems))
+ puts_P(PSTR("Not a valid Keyboard." ESC_FG_WHITE));
+ else
+ printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
/* Indicate error via status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -200,7 +204,7 @@ void Keyboard_HID_Task(void) ((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0)));
}
- puts_P(PSTR("HID Device Enumerated.\r\n"));
+ puts_P(PSTR("Keyboard Enumerated.\r\n"));
USB_HostState = HOST_STATE_Configured;
break;
|