X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/cc879df4f014e403e57caca50a5791c996c0d79c..864196c884ef3602aee44f1a68aceb5819a07f21:/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c?ds=inline diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c index 5d39bf902..1a53526ba 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c @@ -43,7 +43,7 @@ int main(void) { SetupHardware(); - puts_P(PSTR(ESC_RESET ESC_FG_CYAN "Keyboard HID Host Demo running.\r\n" ESC_FG_WHITE)); + puts_P(PSTR(ESC_FG_CYAN "Keyboard HID Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); @@ -156,10 +156,7 @@ void ReadNextReport(void) if (KeyboardReport.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; @@ -230,9 +227,6 @@ void Keyboard_HID_Task(void) break; } - USB_HostState = HOST_STATE_Configured; - break; - case HOST_STATE_Configured: /* HID class request to set the keyboard protocol to the Boot Protocol */ USB_ControlRequest = (USB_Request_Header_t) { @@ -262,9 +256,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: /* If a report has been received, read and process it */ ReadNextReport();