Minor updates to the Benito programmer - remove redundant PORT register manipulations.
[pub/USBasp.git] / Demos / Device / ClassDriver / DualCDC / DualCDC.c
index ca33f10..adc17ae 100644 (file)
  *  within a device can be differentiated from one another. This is for the first CDC interface,\r
  *  which sends strings to the host for each joystick movement.\r
  */\r
-USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =\r
+USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =\r
        {\r
-               .ControlInterfaceNumber     = 0,\r
+               .Config =\r
+                       {\r
+                               .ControlInterfaceNumber     = 0,\r
 \r
-               .DataINEndpointNumber       = CDC1_TX_EPNUM,\r
-               .DataINEndpointSize         = CDC_TXRX_EPSIZE,\r
+                               .DataINEndpointNumber       = CDC1_TX_EPNUM,\r
+                               .DataINEndpointSize         = CDC_TXRX_EPSIZE,\r
 \r
-               .DataOUTEndpointNumber      = CDC1_RX_EPNUM,\r
-               .DataOUTEndpointSize        = CDC_TXRX_EPSIZE,\r
+                               .DataOUTEndpointNumber      = CDC1_RX_EPNUM,\r
+                               .DataOUTEndpointSize        = CDC_TXRX_EPSIZE,\r
 \r
-               .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,\r
-               .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\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
@@ -60,18 +68,26 @@ USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =
  *  within a device can be differentiated from one another. This is for the second CDC interface,\r
  *  which echos back all received data from the host.\r
  */\r
-USB_ClassInfo_CDC_t VirtualSerial2_CDC_Interface =\r
+USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =\r
        {\r
-               .ControlInterfaceNumber     = 2,\r
-\r
-               .DataINEndpointNumber       = CDC2_TX_EPNUM,\r
-               .DataINEndpointSize         = CDC_TXRX_EPSIZE,\r
-\r
-               .DataOUTEndpointNumber      = CDC2_RX_EPNUM,\r
-               .DataOUTEndpointSize        = CDC_TXRX_EPSIZE,\r
-\r
-               .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,\r
-               .NotificationEndpointSize   = CDC_NOTIFICATION_EPSIZE,\r
+               .Config =\r
+                       {\r
+                               .ControlInterfaceNumber     = 2,\r
+\r
+                               .DataINEndpointNumber       = CDC2_TX_EPNUM,\r
+                               .DataINEndpointSize         = CDC_TXRX_EPSIZE,\r
+\r
+                               .DataOUTEndpointNumber      = CDC2_RX_EPNUM,\r
+                               .DataOUTEndpointSize        = CDC_TXRX_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
@@ -128,7 +144,7 @@ void CheckJoystickMovement(void)
        char*       ReportString  = NULL;\r
        static bool ActionSent = false;\r
 \r
-       char* JoystickStrings[] =\r
+       char* const JoystickStrings[] =\r
                {\r
                        "Joystick Up\r\n",\r
                        "Joystick Down\r\n",\r