Some minor whitespace corrections.
[pub/USBasp.git] / Demos / Device / LowLevel / Keyboard / Keyboard.c
index 06806b5..35ef41b 100644 (file)
@@ -118,19 +118,25 @@ void EVENT_USB_Disconnect(void)
  *  of the USB device after enumeration, and configures the keyboard device endpoints.\r
  */\r
 void EVENT_USB_ConfigurationChanged(void)\r
-{\r
-       /* Setup Keyboard Keycode Report Endpoint */\r
-       Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,\r
-                                      ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,\r
-                                  ENDPOINT_BANK_SINGLE);\r
-\r
-       /* Setup Keyboard LED Report Endpoint */\r
-       Endpoint_ConfigureEndpoint(KEYBOARD_LEDS_EPNUM, EP_TYPE_INTERRUPT,\r
-                                      ENDPOINT_DIR_OUT, KEYBOARD_EPSIZE,\r
-                                  ENDPOINT_BANK_SINGLE);\r
-\r
+{      \r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
+\r
+       /* Setup Keyboard Keycode Report Endpoint */\r
+       if (!(Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,\r
+                                            ENDPOINT_DIR_IN, KEYBOARD_EPSIZE,\r
+                                        ENDPOINT_BANK_SINGLE)))\r
+       {\r
+               LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+       }\r
+       \r
+       /* Setup Keyboard LED Report Endpoint */\r
+       if (!(Endpoint_ConfigureEndpoint(KEYBOARD_LEDS_EPNUM, EP_TYPE_INTERRUPT,\r
+                                            ENDPOINT_DIR_OUT, KEYBOARD_EPSIZE,\r
+                                        ENDPOINT_BANK_SINGLE)))\r
+       {\r
+               LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+       }\r
 }\r
 \r
 /** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r