aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-09-16 18:18:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-09-16 18:18:07 +0000
commite186907e393939f1b417f0f7ba7406b46c76bece (patch)
treee3267282ed812b7c07b58faf1546644248e2c7b3 /LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
parent3e1f3869c1678fa89c40e9afef06efa2d7f24326 (diff)
downloadlufa-e186907e393939f1b417f0f7ba7406b46c76bece.tar.gz
lufa-e186907e393939f1b417f0f7ba7406b46c76bece.tar.bz2
lufa-e186907e393939f1b417f0f7ba7406b46c76bece.zip
Fixed lengthy timeouts in the USBtoSerial project if no application on the host is consuming data (thanks to Nicolas Saugnier).
Fixed lengthy automatic data flushing in the CDC and MIDI device class drivers.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/CDCClassDevice.c')
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDCClassDevice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
index ff0f9bb55..61f4be9d7 100644
--- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
+++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c
@@ -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
}