From cf2776531c04b0ebe4fdd9d4ef5324dacefd5639 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 31 Aug 2009 12:43:28 +0000 Subject: Add extra check for OUT ZLP in the CDC Device Class driver service task to quickly clear zero-length termination packets from the host. --- LUFA/Drivers/USB/Class/Device/CDC.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'LUFA/Drivers/USB/Class/Device') diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index 31fd8f1b0..816a5f13d 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -118,6 +118,11 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo) if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) return; + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber); + + if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint())) + Endpoint_ClearOUT(); + CDC_Device_Flush(CDCInterfaceInfo); } -- cgit v1.2.3