Minor documentation enhancements.
[pub/USBasp.git] / Projects / USBtoSerial / USBtoSerial.c
index c2ecc7c..845c2a5 100644 (file)
@@ -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. */
@@ -206,6 +207,6 @@ void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCI
        
        /* Reconfigure the USART in double speed mode for a wider baud rate range at the expense of accuracy */
        UCSR1C = ConfigMask;
-       UCSR1A = (1 << U2X1);   
+       UCSR1A = (1 << U2X1);
        UCSR1B = ((1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1));
 }