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