Fix issue with CDC device demos causing broken communications when the device tries...
[pub/lufa.git] / LUFA / Drivers / USB / Class / Device / CDC.c
index 0359afe..9ed20e4 100644 (file)
@@ -139,16 +139,16 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)
 \r
 void CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, char* const Data, const uint16_t Length)\r
 {\r
-       if (USB_DeviceState != DEVICE_STATE_Configured)\r
+       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))\r
          return;\r
-\r
+       \r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);\r
        Endpoint_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);\r
 }\r
 \r
 void CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data)\r
 {\r
-       if (USB_DeviceState != DEVICE_STATE_Configured)\r
+       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))\r
          return;\r
 \r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber);\r