X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/cc879df4f014e403e57caca50a5791c996c0d79c..eff07bb87758a12064d9de9c859b1e6e6502f2ea:/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c?ds=sidebyside diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index e9af2253d..2cc08a13d 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -43,7 +43,7 @@ int main(void) { SetupHardware(); - puts_P(PSTR(ESC_RESET ESC_FG_CYAN "Keyboard HID Parser Host Demo running.\r\n" ESC_FG_WHITE)); + puts_P(PSTR(ESC_FG_CYAN "Keyboard HID Parser Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); @@ -166,9 +166,6 @@ void Keyboard_HID_Task(void) break; } - USB_HostState = HOST_STATE_Configured; - break; - case HOST_STATE_Configured: puts_P(PSTR("Processing HID Report.\r\n")); /* Get and process the device's first HID report descriptor */ @@ -187,9 +184,9 @@ void Keyboard_HID_Task(void) puts_P(PSTR("Keyboard Enumerated.\r\n")); - USB_HostState = HOST_STATE_Ready; + USB_HostState = HOST_STATE_Configured; break; - case HOST_STATE_Ready: + case HOST_STATE_Configured: /* Select and unfreeze keyboard data pipe */ Pipe_SelectPipe(KEYBOARD_DATAPIPE); Pipe_Unfreeze(); @@ -253,10 +250,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport) if (KeyCode) { /* Toggle status LED to indicate keypress */ - if (LEDs_GetLEDs() & LEDS_LED2) - LEDs_TurnOffLEDs(LEDS_LED2); - else - LEDs_TurnOnLEDs(LEDS_LED2); + LEDs_ToggleLEDs(LEDS_LED2); char PressedKey = 0;