From 2f6261badb8281956a5447ab4a52a17256a3e6f0 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 13 Nov 2020 22:34:04 +0100 Subject: [PATCH] ReaderIso14443a: save/restore timeout --- armsrc/iso14443a.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index a70b9b953..806c63091 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1301,7 +1301,7 @@ void SimulateIso14443aTag(uint8_t tagType, uint8_t flags, uint8_t *data) { // We need to listen to the high-frequency, peak-detected path. iso14443a_setup(FPGA_HF_ISO14443A_TAGSIM_LISTEN); - iso14a_set_timeout(201400); // 106 * 19ms default + iso14a_set_timeout(201400); // 106 * 19ms default *100? int len = 0; @@ -2903,9 +2903,11 @@ void ReaderIso14443a(PacketCommandNG *c) { goto OUT; } } - - if ((param & ISO14A_SET_TIMEOUT)) + uint32_t save_iso14a_timeout = 0; + if ((param & ISO14A_SET_TIMEOUT)) { + save_iso14a_timeout = iso14a_get_timeout(); iso14a_set_timeout(timeout); + } if ((param & ISO14A_APDU)) { uint8_t res; @@ -2969,6 +2971,10 @@ void ReaderIso14443a(PacketCommandNG *c) { if ((param & ISO14A_REQUEST_TRIGGER)) iso14a_set_trigger(false); + if ((param & ISO14A_SET_TIMEOUT)) { + iso14a_set_timeout(save_iso14a_timeout); + } + if ((param & ISO14A_NO_DISCONNECT)) return;