X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/44179abcf85acb14fb3aff72ce50ae84281c0f2e..e071f3897a0946c6be1e1b5e1f78eda8dcbf6fc7:/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c?ds=inline diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c index 4c88bb4f2..cb051cdf1 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c @@ -54,7 +54,11 @@ uint8_t Printer_SendData(Printer_Data_t* PrinterCommands) return ErrorCode; Pipe_ClearOUT(); - while (!(Pipe_IsOUTReady())); + while (!(Pipe_IsOUTReady())) + { + if (USB_HostState == HOST_STATE_Unattached) + return PIPE_RWSTREAM_DeviceDisconnected; + } Pipe_Freeze();