diff options
Diffstat (limited to 'Demos/Device/LowLevel/MIDI/MIDI.c')
-rw-r--r-- | Demos/Device/LowLevel/MIDI/MIDI.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index a9843ed8c..5570dd16e 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -91,23 +91,16 @@ void EVENT_USB_Device_Disconnect(void) */ void EVENT_USB_Device_ConfigurationChanged(void) { - /* Indicate USB connected and ready */ - LEDs_SetAllLEDs(LEDMASK_USB_READY); + bool ConfigSuccess = true; - /* Setup MIDI stream endpoints */ - if (!(Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_OUT, MIDI_STREAM_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } - - if (!(Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_IN, MIDI_STREAM_EPSIZE, - ENDPOINT_BANK_SINGLE))) - { - LEDs_SetAllLEDs(LEDMASK_USB_ERROR); - } + /* Setup MIDI Data Endpoints */ + ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, + MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, + MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); + + /* Indicate endpoint configuration success or failure */ + LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); } /** Task to handle the generation of MIDI note change events in response to presses of the board joystick, and send them |