From e6881fd166586793a5a90effeefe4188092f383b Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 8 Jun 2009 07:46:07 +0000 Subject: 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. --- Demos/Device/LowLevel/AudioInput/AudioInput.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Demos/Device/LowLevel/AudioInput/AudioInput.c') diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 7757ef10c..50e7f4df4 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -109,13 +109,16 @@ void EVENT_USB_Disconnect(void) */ void EVENT_USB_ConfigurationChanged(void) { - /* Setup audio stream endpoint */ - Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, - ENDPOINT_DIR_IN, AUDIO_STREAM_EPSIZE, - ENDPOINT_BANK_DOUBLE); - /* Indicate USB connected and ready */ LEDs_SetAllLEDs(LEDMASK_USB_READY); + + /* Setup audio stream endpoint */ + if (!(Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, + ENDPOINT_DIR_IN, AUDIO_STREAM_EPSIZE, + ENDPOINT_BANK_DOUBLE))) + { + LEDs_SetAllLEDs(LEDMASK_USB_ERROR); + } } /** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific -- cgit v1.2.3