Fixed (?) issues from PR #129

This commit is contained in:
Martin Holst Swende 2015-07-16 23:50:41 +02:00
commit 976627d5ba
3 changed files with 13 additions and 3 deletions

View file

@ -670,6 +670,7 @@ int CmdT55xxWriteBlock(const char *Cmd)
}
UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {data, block, 0}};
UsbCommand resp;
c.d.asBytes[0] = 0x0;
PrintAndLog("Writing to block: %d data : 0x%08X", block, data);
@ -681,6 +682,10 @@ int CmdT55xxWriteBlock(const char *Cmd)
PrintAndLog("pwd : 0x%08X", password);
}
SendCommand(&c);
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
PrintAndLog("Error occurred, device did not ACK write operation. (May be due to old firmware)");
return -1;
}
return 0;
}