Commit for the 090810 release.
[pub/USBasp.git] / Demos / Device / ClassDriver / USBtoSerial / USBtoSerial.c
index 8953706..0c83cd8 100644 (file)
@@ -61,11 +61,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
                                .NotificationEndpointNumber = CDC_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
@@ -95,7 +90,7 @@ int main(void)
                if (Tx_Buffer.Elements)\r
                  CDC_Device_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Tx_Buffer));\r
                \r
-               /* Read bytes from the USART transmit buffer into the USART */\r
+               /* Load bytes from the USART transmit buffer into the USART */\r
                if (Rx_Buffer.Elements)\r
                  Serial_TxByte(Buffer_GetElement(&Rx_Buffer));\r
                \r
@@ -115,25 +110,25 @@ void SetupHardware(void)
        clock_prescale_set(clock_div_1);\r
 \r
        /* Hardware Initialization */\r
-       Joystick_Init();\r
+       Serial_Init(9600, false);\r
        LEDs_Init();\r
        USB_Init();\r
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -141,10 +136,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlPacket(void)\r
 {\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
 }\r
 \r
 /** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer\r