mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
fix hw status (and USB comm in general) (#434)
* don't ignore ReadLine() errors (Windows) * lock CmdBuffer with Mutex * refactor WaitForResponseTimeoutW
This commit is contained in:
parent
a6d4e93cb5
commit
23af9327a5
3 changed files with 25 additions and 12 deletions
|
@ -73,12 +73,11 @@ static void *uart_receiver(void *targ) {
|
|||
|
||||
while (arg->run) {
|
||||
rxlen = 0;
|
||||
if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen)) {
|
||||
if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen) && rxlen) {
|
||||
prx += rxlen;
|
||||
if (prx-rx < sizeof(UsbCommand)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
UsbCommandReceived((UsbCommand*)rx);
|
||||
}
|
||||
prx = rx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue