Add MIDI class driver, update MIDI device demo to use the new USB class driver. All...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / CDC.c
index 8acaac7..dcb58dc 100644 (file)
@@ -136,6 +136,9 @@ void USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint1
 \r
 void USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data)\r
 {\r
+       if (!(USB_IsConnected))\r
+         return;\r
+\r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->DataINEndpointNumber);\r
 \r
        if (!(Endpoint_IsReadWriteAllowed()))\r