diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-08 07:46:07 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-08 07:46:07 +0000 |
commit | e6881fd166586793a5a90effeefe4188092f383b (patch) | |
tree | 18812dc15a6837bd283593fa4da59cee89a3b1ed /Demos/Device/LowLevel/Joystick | |
parent | ac70ddd0a1c412bb54def48e53caaebd0b5c9c61 (diff) | |
download | lufa-e6881fd166586793a5a90effeefe4188092f383b.tar.gz lufa-e6881fd166586793a5a90effeefe4188092f383b.tar.bz2 lufa-e6881fd166586793a5a90effeefe4188092f383b.zip |
Error status LEDs shown when device endpoint configuration fails to complete.
MIDI device demo no longer blocks if a note change event is sent while the endpoint is not ready.
Diffstat (limited to 'Demos/Device/LowLevel/Joystick')
-rw-r--r-- | Demos/Device/LowLevel/Joystick/Joystick.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 94763b82a..0c018aa8d 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -92,13 +92,16 @@ void EVENT_USB_Disconnect(void) */
void EVENT_USB_ConfigurationChanged(void)
{
- /* Setup Joystick Report Endpoint */
- Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT,
- ENDPOINT_DIR_IN, JOYSTICK_EPSIZE,
- ENDPOINT_BANK_SINGLE);
-
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
+
+ /* Setup Joystick Report Endpoint */
+ if (!(Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, JOYSTICK_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
|