X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d1e52660368d34d693131f6aff3c8fd8584162e5..2793c88fc601dcc7ec4961326dd9748a20f3ec83:/LUFA/Drivers/USB/Class/Device/CDC.c diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index 8acaac7a1..dface2a6d 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -73,7 +73,7 @@ void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo) CDCInterfaceInfo->ControlLineState = USB_ControlRequest.wValue; - EVENT_USB_CDC_ControLineStateChanged(); + EVENT_USB_CDC_ControLineStateChanged(CDCInterfaceInfo); while (!(Endpoint_IsINReady())); Endpoint_ClearIN(); @@ -136,6 +136,9 @@ void USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint1 void USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data) { + if (!(USB_IsConnected)) + return; + Endpoint_SelectEndpoint(CDCInterfaceInfo->DataINEndpointNumber); if (!(Endpoint_IsReadWriteAllowed())) @@ -166,7 +169,7 @@ uint8_t USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo) return DataByte; } -void USB_CDC_SendSerialLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask) +void USB_CDC_SendSerialLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask) { Endpoint_SelectEndpoint(CDCInterfaceInfo->NotificationEndpointNumber);