mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-10-06 19:27:01 +08:00
style
This commit is contained in:
parent
c92914d972
commit
af9567a19e
7 changed files with 36 additions and 31 deletions
|
@ -90,7 +90,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
|
|||
|
||||
// Setup and start DMA.
|
||||
if (!FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE)) {
|
||||
if (g_dbglevel > 1) {
|
||||
if (g_dbglevel > DBG_ERROR) {
|
||||
Dbprintf("FpgaSetupSscDma failed. Exiting");
|
||||
}
|
||||
return;
|
||||
|
@ -161,7 +161,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
|
|||
if (triggered) {
|
||||
if ((receivedCmd) &&
|
||||
((receivedCmd[0] == MIFARE_ULEV1_AUTH) || (receivedCmd[0] == MIFARE_ULC_AUTH_1))) {
|
||||
if (g_dbglevel > 1)
|
||||
if (g_dbglevel > DBG_ERROR)
|
||||
Dbprintf("PWD-AUTH KEY: 0x%02x%02x%02x%02x", receivedCmd[1], receivedCmd[2],
|
||||
receivedCmd[3], receivedCmd[4]);
|
||||
|
||||
|
@ -225,7 +225,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
|
|||
|
||||
// Write stuff to spiffs logfile
|
||||
if (auth_attempts > 0) {
|
||||
if (g_dbglevel > 1)
|
||||
if (g_dbglevel > DBG_ERROR)
|
||||
Dbprintf("[!] Authentication attempts = %u", auth_attempts);
|
||||
|
||||
if (!exists_in_spiffs((char *)HF_BOG_LOGFILE)) {
|
||||
|
@ -235,7 +235,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
|
|||
}
|
||||
}
|
||||
|
||||
if (g_dbglevel > 1)
|
||||
if (g_dbglevel > DBG_ERROR)
|
||||
Dbprintf("[!] Wrote %u Authentication attempts into logfile", auth_attempts);
|
||||
|
||||
SpinErr(LED_A, 200, 5);
|
||||
|
|
|
@ -635,7 +635,7 @@ int FpgaGetCurrent(void) {
|
|||
// if HF, Disable SSC DMA
|
||||
// turn off trace and leds off.
|
||||
void switch_off(void) {
|
||||
if (g_dbglevel > 3) {
|
||||
if (g_dbglevel > DBG_DEBUG) {
|
||||
Dbprintf("switch_off");
|
||||
}
|
||||
|
||||
|
|
14
armsrc/i2c.c
14
armsrc/i2c.c
|
@ -401,7 +401,7 @@ bool I2C_WriteCmd(uint8_t device_cmd, uint8_t device_address) {
|
|||
|
||||
if (_break) {
|
||||
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ bool I2C_WriteByte(uint8_t data, uint8_t device_cmd, uint8_t device_address) {
|
|||
|
||||
I2C_Stop();
|
||||
if (_break) {
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -479,7 +479,7 @@ bool I2C_BufferWrite(const uint8_t *data, uint16_t len, uint8_t device_cmd, uint
|
|||
|
||||
I2C_Stop();
|
||||
if (_break) {
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -530,7 +530,7 @@ int16_t I2C_BufferRead(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t
|
|||
|
||||
if (_break) {
|
||||
I2C_Stop();
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ int16_t I2C_ReadFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t
|
|||
|
||||
if (_break) {
|
||||
I2C_Stop();
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -713,7 +713,7 @@ bool I2C_WriteFW(const uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uin
|
|||
I2C_Stop();
|
||||
|
||||
if (_break) {
|
||||
if (g_dbglevel > 3) DbpString(I2C_ERROR);
|
||||
if (g_dbglevel > DBG_DEBUG) DbpString(I2C_ERROR);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -825,7 +825,7 @@ bool GetATR(smart_card_atr_t *card_ptr, bool verbose) {
|
|||
chksum ^= card_ptr->atr[i];
|
||||
|
||||
if (chksum) {
|
||||
if (g_dbglevel > 2) DbpString("Wrong ATR checksum");
|
||||
if (g_dbglevel > DBG_INFO) DbpString("Wrong ATR checksum");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -374,7 +374,7 @@ void loadT55xxConfig(void) {
|
|||
memcpy((uint8_t *)&T55xx_Timing, buf, T55XX_CONFIG_LEN);
|
||||
|
||||
if (size == T55XX_CONFIG_LEN) {
|
||||
if (g_dbglevel > 1) DbpString("T55XX Config load success");
|
||||
if (g_dbglevel > DBG_ERROR) DbpString("T55XX Config load success");
|
||||
}
|
||||
|
||||
BigBuf_free();
|
||||
|
@ -1889,7 +1889,7 @@ void T55xxDangerousRawTest(const uint8_t *data, bool ledcontrol) {
|
|||
for (uint8_t i = 0; i < c->bitlen; i++)
|
||||
len = T55xx_SetBits(bs, len, c->data[i], 1, sizeof(bs));
|
||||
|
||||
if (g_dbglevel > 1) {
|
||||
if (g_dbglevel > DBG_ERROR) {
|
||||
Dbprintf("LEN %i, TIMING %i", len, c->time);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
uint8_t sendbits = (bs[BITSTREAM_BYTE(i)] >> BITSTREAM_BIT(i));
|
||||
|
|
|
@ -591,14 +591,18 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *uid, uint16_t
|
|||
}
|
||||
LEDsoff();
|
||||
cardSTATE = MFEMUL_NOFIELD;
|
||||
if (g_dbglevel >= DBG_EXTENDED)
|
||||
|
||||
if (g_dbglevel >= DBG_EXTENDED) {
|
||||
Dbprintf("cardSTATE = MFEMUL_NOFIELD");
|
||||
}
|
||||
continue;
|
||||
|
||||
} else if (res == 1) { // button pressed
|
||||
FpgaDisableTracing();
|
||||
button_pushed = true;
|
||||
if (g_dbglevel >= DBG_EXTENDED)
|
||||
if (g_dbglevel >= DBG_EXTENDED) {
|
||||
Dbprintf("Button pressed");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1438,6 +1442,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *uid, uint16_t
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g_dbglevel >= DBG_ERROR) {
|
||||
Dbprintf("Emulator stopped. Tracing: %d trace length: %d ", get_tracing(), BigBuf_get_traceLen());
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
|||
// Setup and start DMA.
|
||||
// set transfer address and number of bytes. Start transfer.
|
||||
if (!FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE)) {
|
||||
if (g_dbglevel > 1) Dbprintf("[!] FpgaSetupSscDma failed. Exiting");
|
||||
if (g_dbglevel > DBG_ERROR) Dbprintf("[!] FpgaSetupSscDma failed. Exiting");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue