X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/864196c884ef3602aee44f1a68aceb5819a07f21..a789619fbe2cd07347816cc5c168e8f904acca86:/Demos/Device/ClassDriver/DualCDC/DualCDC.c?ds=inline diff --git a/Demos/Device/ClassDriver/DualCDC/DualCDC.c b/Demos/Device/ClassDriver/DualCDC/DualCDC.c index 0de83e1d9..82ed59d51 100644 --- a/Demos/Device/ClassDriver/DualCDC/DualCDC.c +++ b/Demos/Device/ClassDriver/DualCDC/DualCDC.c @@ -78,11 +78,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface = .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM, .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, }, - - .State = - { - // Leave all state values to their defaults - } }; /** Main program entry point. This routine contains the overall program flow, including initial @@ -99,13 +94,11 @@ int main(void) CheckJoystickMovement(); /* Discard all received data on the first CDC interface */ - uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface); - while (BytesToDiscard--) + while (CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface)) CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface); /* Echo all received data on the second CDC interface */ - uint16_t BytesToEcho = CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface); - while (BytesToEcho--) + while (CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface)) CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface)); CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);