X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/33a018474913701fa9ef8e962acf58accd1184d2..b2330934b9ccd51a59183eb2a11fdd95183df27b:/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index 9127fea9e..ddfe05a4b 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -100,23 +100,32 @@ void EVENT_USB_Disconnect(void) */ void EVENT_USB_ConfigurationChanged(void) { - /* Setup Keyboard Report Endpoint */ - Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, - ENDPOINT_DIR_IN, HID_EPSIZE, - ENDPOINT_BANK_SINGLE); + /* Indicate USB connected and ready */ + LEDs_SetAllLEDs(LEDMASK_USB_READY); + /* Setup Keyboard Report Endpoint */ + if (!(Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, + ENDPOINT_DIR_IN, HID_EPSIZE, + ENDPOINT_BANK_SINGLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } + /* Setup Keyboard LED Report Endpoint */ - Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, - ENDPOINT_DIR_OUT, HID_EPSIZE, - ENDPOINT_BANK_SINGLE); + if (!(Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, + ENDPOINT_DIR_OUT, HID_EPSIZE, + ENDPOINT_BANK_SINGLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } /* Setup Mouse Report Endpoint */ - Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, - ENDPOINT_DIR_IN, HID_EPSIZE, - ENDPOINT_BANK_SINGLE); - - /* Indicate USB connected and ready */ - LEDs_SetAllLEDs(LEDMASK_USB_READY); + if (!(Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, + ENDPOINT_DIR_IN, HID_EPSIZE, + ENDPOINT_BANK_SINGLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } } /** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific