Fixed lengthy timeouts in the USBtoSerial project if no application on the host is...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / CDCClassDevice.c
index ff0f9bb..61f4be9 100644 (file)
@@ -138,7 +138,10 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo)
          return;
 
        #if !defined(NO_CLASS_DRIVER_AUTOFLUSH)
-       CDC_Device_Flush(CDCInterfaceInfo);
+       Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
+       
+       if (Endpoint_IsINReady())
+         CDC_Device_Flush(CDCInterfaceInfo);
        #endif
 }