aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/MassStorage
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-08 07:46:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-08 07:46:07 +0000
commite6881fd166586793a5a90effeefe4188092f383b (patch)
tree18812dc15a6837bd283593fa4da59cee89a3b1ed /Demos/Device/LowLevel/MassStorage
parentac70ddd0a1c412bb54def48e53caaebd0b5c9c61 (diff)
downloadlufa-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/MassStorage')
-rw-r--r--Demos/Device/LowLevel/MassStorage/MassStorage.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c
index 62c7f21da..ee2a9d792 100644
--- a/Demos/Device/LowLevel/MassStorage/MassStorage.c
+++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c
@@ -106,17 +106,23 @@ void EVENT_USB_Disconnect(void)
*/
void EVENT_USB_ConfigurationChanged(void)
{
+ /* Indicate USB connected and ready */
+ LEDs_SetAllLEDs(LEDMASK_USB_READY);
+
/* Setup Mass Storage In and Out Endpoints */
- Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,
+ if (!(Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_IN, MASS_STORAGE_IO_EPSIZE,
- ENDPOINT_BANK_DOUBLE);
-
- Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_BANK_DOUBLE)))
+ {
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ }
+
+ if (!(Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_OUT, MASS_STORAGE_IO_EPSIZE,
- ENDPOINT_BANK_DOUBLE);
-
- /* Indicate USB connected and ready */
- LEDs_SetAllLEDs(LEDMASK_USB_READY);
+ ENDPOINT_BANK_DOUBLE)))
+ {
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ }
}
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific