From 8f2b9b9d66a74871f7d814c6b41443fe66629ccb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 17 Sep 2020 22:17:16 +0200 Subject: [PATCH] less field timeup before first transmit --- armsrc/hitag2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index eab276bad..dc630e3fd 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1431,13 +1431,14 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { // init as reader lf_init(true, false); + FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); uint8_t tag_modulation; size_t max_nrzs = (8 * HITAG_FRAME_LEN + 5) * 2; // up to 2 nrzs per bit uint8_t nrz_samples[max_nrzs]; + bool turn_on = true; size_t nrzs = 0; int16_t checked = 0; - uint32_t signal_size = 10000; while (bStop == false && BUTTON_PRESS() == false) { @@ -1498,6 +1499,11 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { goto out; } } + + if (turn_on) { + FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_ADC | FPGA_LF_ADC_READER_FIELD); + turn_on = false; + } // Wait for t_wait_2 carrier periods after the last tag bit before transmitting, lf_wait_periods(t_wait_2);