}\r
\r
UsbCommand resp;\r
- if (WaitForResponseTimeout(CMD_ACK,&resp,2000)) {\r
+ if (WaitForResponseTimeoutW(CMD_ACK, &resp, 2000, false)) {\r
res = resp.arg[0] & 0xff;\r
uint16_t traceLen = resp.arg[1];\r
len = resp.arg[2];\r
\r
if (res == 0) { // we are done\r
- free(buf);\r
- return 0;\r
+ break;\r
}\r
\r
if (res == 1) { // there is (more) data to be transferred\r
} // while (true)\r
\r
free(buf);\r
+ \r
+ msleep(300); // wait for exiting arm side.\r
+ PrintAndLog("Done.");\r
return 0;\r
}\r
\r