Add extra check for OUT ZLP in the CDC Device Class driver service task to quickly...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / CDC.c
index 31fd8f1..816a5f1 100644 (file)
@@ -118,6 +118,11 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)
        if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))\r
          return;\r
 \r
+       Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataOUTEndpointNumber);\r
+\r
+       if (Endpoint_IsOUTReceived() && !(Endpoint_BytesInEndpoint()))\r
+         Endpoint_ClearOUT();\r
+         \r
        CDC_Device_Flush(CDCInterfaceInfo);\r
 }\r
 \r