diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index ccf5be9e2..853721840 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1809,7 +1809,7 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) { if (!is1b) { ReaderTransmit(wupC2, sizeof(wupC2), NULL); if (!ReaderReceive(receivedAnswer, receivedAnswerPar) || (receivedAnswer[0] != 0x0a)) { - if (MF_DBGLEVEL >= MF_DBG_ALL) Dbprintf("Assuming Magic Gen 1B tag. [wupC2 failed]"); + if (MF_DBGLEVEL >= MF_DBG_INFO) Dbprintf("Assuming Magic Gen 1B tag. [wupC2 failed]"); is1b = true; continue; } @@ -1887,7 +1887,7 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) { if (!is1b) { ReaderTransmit(wupC2, sizeof(wupC2), NULL); if (!ReaderReceive(receivedAnswer, receivedAnswerPar) || (receivedAnswer[0] != 0x0a)) { - if (MF_DBGLEVEL >= MF_DBG_ALL) Dbprintf("Assuming Magic Gen 1B tag. [wupC2 failed]"); + if (MF_DBGLEVEL >= MF_DBG_INFO) Dbprintf("Assuming Magic Gen 1B tag. [wupC2 failed]"); is1b = true; continue; } diff --git a/armsrc/mifaresim.c b/armsrc/mifaresim.c index 67d97acf4..7cb7b1860 100644 --- a/armsrc/mifaresim.c +++ b/armsrc/mifaresim.c @@ -13,9 +13,10 @@ // Verbose Mode: // MF_DBG_NONE 0 // MF_DBG_ERROR 1 -// MF_DBG_ALL 2 +// MF_DBG_INFO 2 +// MF_DBG_DEBUG 3 // MF_DBG_EXTENDED 4 -// + // /!\ Printing Debug message is disrupting emulation, // Only use with caution during debugging diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 34266cd41..94ea29b03 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -216,7 +216,7 @@ int mifare_classic_readblock(struct Crypto1State *pcs, uint32_t uid, uint8_t blo memcpy(bt, receivedAnswer + 16, 2); AddCrc14A(receivedAnswer, 16); if (bt[0] != receivedAnswer[16] || bt[1] != receivedAnswer[17]) { - if (MF_DBGLEVEL >= MF_DBG_ALL) Dbprintf("Cmd CRC response error."); + if (MF_DBGLEVEL >= MF_DBG_INFO) Dbprintf("Cmd CRC response error."); return 3; } diff --git a/armsrc/mifareutil.h b/armsrc/mifareutil.h index 38494ceb0..46f6fa81a 100644 --- a/armsrc/mifareutil.h +++ b/armsrc/mifareutil.h @@ -34,13 +34,6 @@ // reader voltage field detector #define MF_MINFIELDV 4000 -// debug -// 0 - no debug messages 1 - error messages 2 - all messages 4 - extended debug mode -#define MF_DBG_NONE 0 -#define MF_DBG_ERROR 1 -#define MF_DBG_ALL 2 -#define MF_DBG_EXTENDED 4 - // Mifare 4k/2k/1k/mini Max Block / Max Sector #define MIFARE_4K_MAXBLOCK 256 #define MIFARE_2K_MAXBLOCK 128 diff --git a/include/common.h b/include/common.h index 8bf8ab702..87f059179 100644 --- a/include/common.h +++ b/include/common.h @@ -23,11 +23,11 @@ extern "C" { typedef unsigned char byte_t; // debug -// 0 - no debug messages 1 - error messages 2 - all messages 4 - extended debug mode -#define MF_DBG_NONE 0 -#define MF_DBG_ERROR 1 -#define MF_DBG_ALL 2 -#define MF_DBG_EXTENDED 4 +#define MF_DBG_NONE 0 // no messages +#define MF_DBG_ERROR 1 // errors only +#define MF_DBG_INFO 2 // errors + info messages +#define MF_DBG_DEBUG 3 // errors + info + debug messages +#define MF_DBG_EXTENDED 4 // errors + info + debug + breaking debug messages extern int MF_DBGLEVEL; // Flashmem spi baudrate