diff --git a/armsrc/Standalone/hf_bog.c b/armsrc/Standalone/hf_bog.c index 93819aed8..b906a71eb 100644 --- a/armsrc/Standalone/hf_bog.c +++ b/armsrc/Standalone/hf_bog.c @@ -89,7 +89,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) { Uart14aInit(receivedCmd, MAX_FRAME_SIZE, receivedCmdPar); // Setup and start DMA. - if (!FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE)) { + if (FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE) == false) { if (g_dbglevel > DBG_ERROR) { Dbprintf("FpgaSetupSscDma failed. Exiting"); } diff --git a/armsrc/iso14443b.c b/armsrc/iso14443b.c index 0ca70b21a..237dbb57c 100644 --- a/armsrc/iso14443b.c +++ b/armsrc/iso14443b.c @@ -2603,7 +2603,7 @@ void SniffIso14443b(void) { dmabuf16_t *dma = get_dma16(); // Setup and start DMA. - if (!FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE)) { + if (FpgaSetupSscDma((uint8_t *) dma->buf, DMA_BUFFER_SIZE) == false) { if (g_dbglevel > DBG_ERROR) DbpString("FpgaSetupSscDma failed. Exiting"); switch_off(); return; diff --git a/armsrc/mifaresniff_disabled.c b/armsrc/mifaresniff_disabled.c index 772dc7e8e..ac6142e91 100644 --- a/armsrc/mifaresniff_disabled.c +++ b/armsrc/mifaresniff_disabled.c @@ -83,8 +83,8 @@ 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 > DBG_ERROR) Dbprintf("[!] FpgaSetupSscDma failed. Exiting"); + if (FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) == false) { + if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting"); return; } diff --git a/armsrc/secc.c b/armsrc/secc.c index bd0387191..67db4e7ab 100644 --- a/armsrc/secc.c +++ b/armsrc/secc.c @@ -403,7 +403,11 @@ bool hid_config_card_jam(const uint8_t *cmd, int len, uint8_t *dma_buf) { // Restore sniffer FPGA mode and re-arm DMA FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_SNIFFER); - FpgaSetupSscDma(dma_buf, DMA_BUFFER_SIZE); + + if (FpgaSetupSscDma(dma_buf, DMA_BUFFER_SIZE) == false) { + if (g_dbglevel > DBG_ERROR) Dbprintf("FpgaSetupSscDma failed. Exiting"); + return false; + } return true; }