State information for class drivers is now zeroed out during enumeration (both in...
[pub/USBasp.git] / Demos / Host / LowLevel / KeyboardHost / KeyboardHost.c
index c2d8dd4..1a53526 100644 (file)
@@ -156,10 +156,7 @@ void ReadNextReport(void)
                if (KeyboardReport.KeyCode)\r
                {\r
                        /* Toggle status LED to indicate keypress */\r
-                       if (LEDs_GetLEDs() & LEDS_LED2)\r
-                         LEDs_TurnOffLEDs(LEDS_LED2);\r
-                       else\r
-                         LEDs_TurnOnLEDs(LEDS_LED2);\r
+                       LEDs_ToggleLEDs(LEDS_LED2);\r
                                  \r
                        char PressedKey = 0;\r
 \r
@@ -230,9 +227,6 @@ void Keyboard_HID_Task(void)
                                break;\r
                        }\r
                                \r
-                       USB_HostState = HOST_STATE_Configured;\r
-                       break;\r
-               case HOST_STATE_Configured:\r
                        /* HID class request to set the keyboard protocol to the Boot Protocol */\r
                        USB_ControlRequest = (USB_Request_Header_t)\r
                                {\r
@@ -262,9 +256,9 @@ void Keyboard_HID_Task(void)
 \r
                        puts_P(PSTR("Keyboard Enumerated.\r\n"));\r
 \r
-                       USB_HostState = HOST_STATE_Ready;\r
+                       USB_HostState = HOST_STATE_Configured;\r
                        break;\r
-               case HOST_STATE_Ready:\r
+               case HOST_STATE_Configured:\r
                        /* If a report has been received, read and process it */\r
                        ReadNextReport();\r
 \r