MF_DBGLEVEL => DBGLEVEL (pm3 side)

This commit is contained in:
Philippe Teuwen 2019-06-06 10:05:09 +02:00
commit 4761ea13f7
21 changed files with 329 additions and 338 deletions

View file

@ -342,7 +342,7 @@ bool I2C_WriteCmd(uint8_t device_cmd, uint8_t device_address) {
I2C_Stop();
if (bBreak) {
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return false;
}
return true;
@ -372,7 +372,7 @@ bool I2C_WriteByte(uint8_t data, uint8_t device_cmd, uint8_t device_address) {
I2C_Stop();
if (bBreak) {
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return false;
}
return true;
@ -410,7 +410,7 @@ bool I2C_BufferWrite(uint8_t *data, uint8_t len, uint8_t device_cmd, uint8_t dev
I2C_Stop();
if (bBreak) {
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return false;
}
return true;
@ -453,7 +453,7 @@ int16_t I2C_BufferRead(uint8_t *data, uint8_t len, uint8_t device_cmd, uint8_t d
if (bBreak) {
I2C_Stop();
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return 0;
}
@ -522,7 +522,7 @@ int16_t I2C_ReadFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t
if (bBreak) {
I2C_Stop();
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return 0;
}
@ -586,7 +586,7 @@ bool I2C_WriteFW(uint8_t *data, uint8_t len, uint8_t msb, uint8_t lsb, uint8_t d
I2C_Stop();
if (bBreak) {
if (MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (DBGLEVEL > 3) DbpString(I2C_ERROR);
return false;
}
return true;
@ -684,7 +684,7 @@ bool GetATR(smart_card_atr_t *card_ptr) {
chksum ^= card_ptr->atr[i];
if (chksum) {
if (MF_DBGLEVEL > 2) DbpString("Wrong ATR checksum");
if (DBGLEVEL > 2) DbpString("Wrong ATR checksum");
}
}
}
@ -740,7 +740,7 @@ void SmartCardRaw(uint64_t arg0, uint64_t arg1, uint8_t *data) {
// asBytes = A0 A4 00 00 02
// arg1 = len 5
bool res = I2C_BufferWrite(data, arg1, ((flags & SC_RAW_T0) ? I2C_DEVICE_CMD_SEND_T0 : I2C_DEVICE_CMD_SEND), I2C_DEVICE_ADDRESS_MAIN);
if (!res && MF_DBGLEVEL > 3) DbpString(I2C_ERROR);
if (!res && DBGLEVEL > 3) DbpString(I2C_ERROR);
// read bytes from module
len = ISO7618_MAX_FRAME;