mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-08 06:00:53 -07:00
fix WaitForResponse (without timeout)
This commit is contained in:
parent
01aa068b6f
commit
df7b80fecc
1 changed files with 1 additions and 2 deletions
|
@ -472,7 +472,6 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t start_time = msclock();
|
uint64_t start_time = msclock();
|
||||||
uint64_t end_time = start_time + ms_timeout;
|
|
||||||
|
|
||||||
if (response == NULL) {
|
if (response == NULL) {
|
||||||
response = &resp;
|
response = &resp;
|
||||||
|
@ -480,7 +479,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
|
||||||
|
|
||||||
// Wait until the command is received
|
// Wait until the command is received
|
||||||
while (true) {
|
while (true) {
|
||||||
if (msclock() > end_time) {
|
if (ms_timeout != -1 && msclock() > start_time + ms_timeout) {
|
||||||
break; // timeout
|
break; // timeout
|
||||||
}
|
}
|
||||||
if (msclock() - start_time > 2000 && show_warning) {
|
if (msclock() - start_time > 2000 && show_warning) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue