X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f896c00c48f04fb9273555ab8d9b1af99f865d25..7f3f39b5750b9ac877798f41efcf82d931d657f8:/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c diff --git a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c index a2ba253d2..e51963c7a 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)); @@ -152,15 +147,15 @@ void EVENT_USB_UnhandledControlPacket(void) */ ISR(USART1_RX_vect, ISR_BLOCK) { - if (USB_IsConnected) + if (USB_DeviceState == DEVICE_STATE_Configured) Buffer_StoreElement(&Tx_Buffer, UDR1); } /** Event handler for the CDC Class driver Line Encoding Changed event. * - * \param CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced + * \param[in] CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced */ -void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo) +void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) { uint8_t ConfigMask = 0;