aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/USBtoSerial
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/USBtoSerial')
-rw-r--r--Projects/USBtoSerial/USBtoSerial.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c
index c2ecc7cf4..b50537e72 100644
--- a/Projects/USBtoSerial/USBtoSerial.c
+++ b/Projects/USBtoSerial/USBtoSerial.c
@@ -139,10 +139,11 @@ void EVENT_USB_Device_Disconnect(void)
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
- LEDs_SetAllLEDs(LEDMASK_USB_READY);
+ bool ConfigSuccess = true;
- if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
- LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
+
+ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Request event. */