diff options
author | Dean Camera <[email protected]> | 2009-06-08 07:46:07 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2009-06-08 07:46:07 +0000 |
commit | e6881fd166586793a5a90effeefe4188092f383b (patch) | |
tree | 18812dc15a6837bd283593fa4da59cee89a3b1ed /Demos/Device/LowLevel/RNDISEthernet | |
parent | ac70ddd0a1c412bb54def48e53caaebd0b5c9c61 (diff) | |
download | qmk_firmware-e6881fd166586793a5a90effeefe4188092f383b.tar.gz qmk_firmware-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/RNDISEthernet')
-rw-r--r-- | Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index e651a1b128..84fc5b4c9d 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -99,21 +99,30 @@ void EVENT_USB_Disconnect(void) */
void EVENT_USB_ConfigurationChanged(void)
{
- /* Setup CDC Notification, Rx and Tx Endpoints */
- Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
- ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ /* Indicate USB connected and ready */
+ LEDs_SetAllLEDs(LEDMASK_USB_READY);
- Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
- ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ /* Setup CDC Notification, Rx and Tx Endpoints */
+ if (!(Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE)))
+ {
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ }
- Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
- ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ if (!(Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
+ ENDPOINT_BANK_SINGLE)))
+ {
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ }
- /* Indicate USB connected and ready */
- LEDs_SetAllLEDs(LEDMASK_USB_READY);
+ if (!(Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
+ ENDPOINT_DIR_IN, CDC_NOTIFICATION_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
|