rename global conn

This commit is contained in:
Philippe Teuwen committed 2021-08-21 20:21:08 +02:00
1 parent 8280fc3c07
commit 6a2f2b3979
23 files changed
+87 -87

No files matched your search

+4 -4
View File
@@ -273,7 +273,7 @@ static int CmdFlashMemLoad(const char *Cmd) {
// fast push mode
conn.block_after_ACK = true;
g_conn.block_after_ACK = true;
while (bytes_remaining > 0) {
uint32_t bytes_in_packet = MIN(FLASH_MEM_BLOCK_SIZE, bytes_remaining);
@@ -293,20 +293,20 @@ static int CmdFlashMemLoad(const char *Cmd) {
PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_FLASHMEM_WRITE, &resp, 2000) == false) {
PrintAndLogEx(WARNING, "timeout while waiting for reply.");
conn.block_after_ACK = false;
g_conn.block_after_ACK = false;
free(data);
return PM3_ETIMEOUT;
}
if (resp.status != PM3_SUCCESS) {
conn.block_after_ACK = false;
g_conn.block_after_ACK = false;
PrintAndLogEx(FAILED, "Flash write fail [offset %u]", bytes_sent);
free(data);
return PM3_EFLASH;
}
}
conn.block_after_ACK = false;
g_conn.block_after_ACK = false;
free(data);
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%zu")" bytes to offset "_GREEN_("%u"), datalen, offset);
return PM3_SUCCESS;