Renamed USB_Device_SetHighSpeed() to USB_Device_SetFullSpeed() so that the correct...
[pub/USBasp.git] / Demos / Device / ClassDriver / DualCDC / DualCDC.c
index adc17ae..82ed59d 100644 (file)
@@ -56,11 +56,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
                                .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,\r
                                .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\r
                        },\r
                                .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,\r
                                .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\r
                        },\r
-               \r
-               .State =\r
-                       {\r
-                               // Leave all state values to their defaults\r
-                       }\r
        };\r
 \r
 /** LUFA CDC Class driver interface configuration and state information. This structure is\r
        };\r
 \r
 /** LUFA CDC Class driver interface configuration and state information. This structure is\r
@@ -83,11 +78,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
                                .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,\r
                                .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\r
                        },\r
                                .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,\r
                                .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\r
                        },\r
-                       \r
-               .State =\r
-                       {\r
-                               // Leave all state values to their defaults\r
-                       }\r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
@@ -104,13 +94,11 @@ int main(void)
                CheckJoystickMovement();\r
 \r
                /* Discard all received data on the first CDC interface */\r
                CheckJoystickMovement();\r
 \r
                /* Discard all received data on the first CDC interface */\r
-               uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface);\r
-               while (BytesToDiscard--)\r
+               while (CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface))\r
                  CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);\r
 \r
                /* Echo all received data on the second CDC interface */\r
                  CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);\r
 \r
                /* Echo all received data on the second CDC interface */\r
-               uint16_t BytesToEcho = CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface);\r
-               while (BytesToEcho--)\r
+               while (CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface))\r
                  CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface));\r
                  \r
                CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);\r
                  CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface));\r
                  \r
                CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);\r