projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Added new USB_DeviceState variable to keep track of the current Device mode USB state.
[pub/USBasp.git]
/
Demos
/
Host
/
LowLevel
/
PrinterHost
/
Lib
/
PrinterCommands.c
diff --git
a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
index
4c88bb4
..
cb051cd
100644
(file)
--- 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;
\r
\r
Pipe_ClearOUT();
\r
- while (!(Pipe_IsOUTReady()));
\r
+ while (!(Pipe_IsOUTReady()))
\r
+ {
\r
+ if (USB_HostState == HOST_STATE_Unattached)
\r
+ return PIPE_RWSTREAM_DeviceDisconnected;
\r
+ }
\r
\r
Pipe_Freeze();
\r
\r