Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Oct 3, 2023
1 parent af685fe commit 4f96d3e
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 171 deletions.
4 changes: 2 additions & 2 deletions armsrc/dbprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ void print_result(const char *name, const uint8_t *d, size_t n) {
}

// Prints message and hexdump
void print_dbg(char *msg, uint8_t *d, uint16_t n) {
void print_dbg(char *msg, uint8_t *d, uint16_t n) {
if (g_dbglevel == DBG_DEBUG) {
print_result(msg, d, n);
}
}
}

/* useful when debugging new protocol implementations like FeliCa
Expand Down
10 changes: 5 additions & 5 deletions armsrc/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static bool I2C_WaitForSim(uint32_t wait) {
// 1000*110*3.07 = 337.7ms (337700)
// 4 560 000 * 3.07 = 13999,2ms (13999200)
// 1byte transfer == 1ms with max frame being 256bytes

// fct WaitSCL_H_delay uses a I2C_DELAY_1CLK in the loop with "wait" as number of iterations.
// I2C_DELAY_1CLK == I2CSpinDelayClk(1) = 3.07us
return WaitSCL_H_delay(wait);
Expand Down Expand Up @@ -474,7 +474,7 @@ bool I2C_BufferWrite(const uint8_t *data, uint16_t len, uint8_t device_cmd, uint
if (len == 0) {
_break = false;
}

} while (false);

I2C_Stop();
Expand Down Expand Up @@ -586,7 +586,7 @@ int16_t I2C_BufferRead(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t
// Dbprintf("rec len... %u readcount... %u", recv_len, readcount);
// Dbhexdump(readcount, pd, false);

if (readcount < 2 ) {
if (readcount < 2) {
return 0;
}

Expand Down Expand Up @@ -771,7 +771,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose) {
if (card_ptr == NULL) {
return false;
}


card_ptr->atr_len = 0;
memset(card_ptr->atr, 0, sizeof(card_ptr->atr));
Expand All @@ -781,7 +781,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose) {
I2C_WriteCmd(I2C_DEVICE_CMD_GENERATE_ATR, I2C_DEVICE_ADDRESS_MAIN);

// wait for sim card to answer.
// 1byte = 1ms , max frame 256bytes. Should wait 256ms atleast just in case.
// 1byte = 1ms , max frame 256bytes. Should wait 256ms atleast just in case.
if (I2C_WaitForSim(SIM_WAIT_DELAY) == false) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/cmdhf14a.c
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ int CmdHF14ANdefRead(const char *Cmd) {
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "--- " _CYAN_("NDEF raw") " ----------------");
print_buffer(ndef_file, ndef_size, 1);
}
}

NDEFRecordsDecodeAndPrint(ndef_file, ndef_size, verbose);

Expand Down
6 changes: 3 additions & 3 deletions client/src/cmdhf15.c
Original file line number Diff line number Diff line change
Expand Up @@ -2184,9 +2184,9 @@ static int CmdHF15Restore(const char *Cmd) {
void *argtable[6 + 5] = {};
uint8_t arglen = arg_add_default(argtable);
argtable[arglen++] = arg_str0("f", "file", "<fn>", "Specify a filename for dump file"),
argtable[arglen++] = arg_int0("r", "retry", "<dec>", "number of retries (def 3)"),
argtable[arglen++] = arg_int0(NULL, "bs", "<dec>", "block size (def 4)"),
argtable[arglen++] = arg_lit0("v", "verbose", "verbose output");
argtable[arglen++] = arg_int0("r", "retry", "<dec>", "number of retries (def 3)"),
argtable[arglen++] = arg_int0(NULL, "bs", "<dec>", "block size (def 4)"),
argtable[arglen++] = arg_lit0("v", "verbose", "verbose output");
argtable[arglen++] = arg_param_end;
CLIExecWithReturn(ctx, Cmd, argtable, true);

Expand Down
2 changes: 1 addition & 1 deletion client/src/cmdhfst25ta.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int CmdHFST25TANdefRead(const char *Cmd) {
n = resplen;

pm3_save_dump(filename, response + 2, n, jsfNDEF);

return PM3_SUCCESS;
}

Expand Down
70 changes: 35 additions & 35 deletions client/src/cmdlft55xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ static int CmdT55xxDump(const char *Cmd) {
data[i] = BSWAP_32(cardmem[i].blockdata);
}

pm3_save_dump(filename, (uint8_t*)data, (T55x7_BLOCK_COUNT * sizeof(uint32_t)), jsfT55x7);
pm3_save_dump(filename, (uint8_t *)data, (T55x7_BLOCK_COUNT * sizeof(uint32_t)), jsfT55x7);
}

return PM3_SUCCESS;
Expand Down Expand Up @@ -3512,24 +3512,24 @@ bool tryDetectP1(bool getData) {

if (FSKrawDemod(0, 0, 0, 0, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

if (FSKrawDemod(0, 1, 0, 0, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}
Expand All @@ -3541,50 +3541,50 @@ bool tryDetectP1(bool getData) {
if (clk > 0) {
if (ASKDemod_ext(0, 0, 1, 0, false, false, false, 1, &st) == PM3_SUCCESS) {

if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

st = true;
if (ASKDemod_ext(0, 1, 1, 0, false, false, false, 1, &st) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

if (ASKbiphaseDemod(0, 0, 0, 2, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

if (ASKbiphaseDemod(0, 0, 1, 2, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}
Expand All @@ -3595,24 +3595,24 @@ bool tryDetectP1(bool getData) {
if (clk > 0) {
if (NRZrawDemod(0, 0, 1, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

if (NRZrawDemod(0, 1, 1, false) == PM3_SUCCESS) {
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}
Expand All @@ -3629,25 +3629,25 @@ bool tryDetectP1(bool getData) {
if (PSKDemod(0, 0, 6, false) == PM3_SUCCESS) {
//save_restoreGB(GRAPH_RESTORE);
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}

if (PSKDemod(0, 1, 6, false) == PM3_SUCCESS) {
//save_restoreGB(GRAPH_RESTORE);
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
}
Expand All @@ -3658,12 +3658,12 @@ bool tryDetectP1(bool getData) {

//save_restoreGB(GRAPH_RESTORE);
if (preambleSearchEx(g_DemodBuffer, preamble_atmel, sizeof(preamble_atmel), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}

if (preambleSearchEx(g_DemodBuffer, preamble_silicon, sizeof(preamble_silicon), &g_DemodBufferLen, &startIdx, false) &&
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
(g_DemodBufferLen == 32 || g_DemodBufferLen == 64)) {
return true;
}
} // inverse waves does not affect PSK2 demod
Expand Down
2 changes: 1 addition & 1 deletion client/src/cmdsmartcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static int CmdSmartRaw(const char *Cmd) {
if (active_select)
payload->flags |= SC_SELECT;
}

payload->wait_delay = 0;
if (timeout > -1) {
payload->flags |= SC_WAIT;
Expand Down
Loading

0 comments on commit 4f96d3e

Please sign in to comment.