X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f896c00c48f04fb9273555ab8d9b1af99f865d25..a789619fbe2cd07347816cc5c168e8f904acca86:/Demos/Device/ClassDriver/DualCDC/DualCDC.c diff --git a/Demos/Device/ClassDriver/DualCDC/DualCDC.c b/Demos/Device/ClassDriver/DualCDC/DualCDC.c index 82bfdc8f7..82ed59d51 100644 --- a/Demos/Device/ClassDriver/DualCDC/DualCDC.c +++ b/Demos/Device/ClassDriver/DualCDC/DualCDC.c @@ -56,11 +56,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface = .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM, .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, }, - - .State = - { - // Leave all state values to their defaults - } }; /** LUFA CDC Class driver interface configuration and state information. This structure is @@ -83,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 @@ -104,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); @@ -144,7 +132,7 @@ void CheckJoystickMovement(void) char* ReportString = NULL; static bool ActionSent = false; - char* JoystickStrings[] = + char* const JoystickStrings[] = { "Joystick Up\r\n", "Joystick Down\r\n",