X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/ff09cf9c73bbc2623a8c1420918747840382cc5b..bea72a8412f99b294c00341fa16a8308bcc66f15:/Projects/USBtoSerial/USBtoSerial.c diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c index c2ecc7cf4..845c2a51c 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. */ @@ -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)); }