From 426c08e2215bb697a0d25ac62642f670c76c7009 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 18 Sep 2020 17:04:45 +0200 Subject: [PATCH] ht2: avoid sending spurious command after command is finished --- armsrc/hitag2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index afe4704b8..a35fade72 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1490,6 +1490,7 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { } case RHT2F_UID_ONLY: { bStop = !hitag2_read_uid(rx, rxlen, tx, &txlen); + if (bSuccessful) bStop = true; attempt_count++; //attempt 3 times to get uid then quit if (!bStop && attempt_count == 3) bStop = true; @@ -1501,7 +1502,7 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { goto out; } } - + if (bStop) break; if (turn_on) { // Wait 50ms with field off to be sure the transponder gets reset SpinDelay(50);