Fix control request hang in Printer device class driver (thanks to Juergen Borleis).
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / PrinterClassDevice.c
index de5e49e..940aacf 100644 (file)
@@ -59,7 +59,7 @@ void PRNT_Device_ProcessControlRequest(USB_ClassInfo_PRNT_Device_t* const PRNTIn
                                }
 
                                uint16_t IEEEStringLen = strlen(PRNTInterfaceInfo->Config.IEEE1284String);
-                               Endpoint_Write_16_BE(IEEEStringLen);
+                               Endpoint_Write_16_BE(IEEEStringLen + sizeof(uint16_t));
                                Endpoint_Write_Control_Stream_LE(PRNTInterfaceInfo->Config.IEEE1284String, IEEEStringLen);
                                Endpoint_ClearStatusStage();
                        }
@@ -77,6 +77,8 @@ void PRNT_Device_ProcessControlRequest(USB_ClassInfo_PRNT_Device_t* const PRNTIn
                                }
 
                                Endpoint_Write_8(PRNTInterfaceInfo->State.PortStatus);
+                               Endpoint_ClearIN();
+
                                Endpoint_ClearStatusStage();
                        }