From 6a83a7dc1af1da722d314e8901e8eda0296def8e Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 30 Sep 2019 19:28:50 +0200 Subject: [PATCH] fix 'lf cmdread' - correct report back on failure --- armsrc/lfops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/armsrc/lfops.c b/armsrc/lfops.c index e8fb49698..4d3d568f4 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -290,10 +290,12 @@ void setT55xxConfig(uint8_t arg0, t55xx_configurations_t *c) { #ifdef WITH_FLASH // shall persist to flashmem if (arg0 == 0) { + BigBuf_free(); return; } if (!FlashInit()) { + BigBuf_free(); return; } @@ -390,7 +392,7 @@ void ModThenAcquireRawAdcSamples125k(uint32_t delay_off, uint32_t period_0, uint WaitMS(200); // if delay_off = 0 then just bitbang 1 = antenna on 0 = off for respective periods. - bool bitbang = delay_off == 0; + bool bitbang = (delay_off == 0); // now modulate the reader field if (bitbang) { // HACK it appears the loop and if statements take up about 7us so adjust waits accordingly... @@ -399,6 +401,7 @@ void ModThenAcquireRawAdcSamples125k(uint32_t delay_off, uint32_t period_0, uint DbpString("[!] Warning periods cannot be less than 7us in bit bang mode"); FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); LED_D_OFF(); + reply_ng(CMD_LF_MOD_THEN_ACQ_RAW_ADC, PM3_EINVARG, NULL, 0); return; }