From fb8f94fa25117aec6bbe7bb9387aca4a4948d3c0 Mon Sep 17 00:00:00 2001 From: Antiklesys Date: Mon, 6 Apr 2026 15:06:09 +0800 Subject: [PATCH] Fixed simulation bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The data_available() check in iso15693.c:1574 fires at any point during the DMA receive loop — including mid-frame while the reader is actively transmitting. When it fires during a CHECK response or during UPDATE transmission, the decoder exits early with -2, iclass.c drains the USB queue and continues — dropping the frame entirely. The reader times out waiting for a response, and restarts from READCHECK. The fix is minimal: gate the data_available() check on the decoder being in STATE_READER_UNSYNCD (i.e., between frames, before SOF detection). Once SOF starts being received, the state transitions away from UNSYNCD and the check won't fire mid-frame. --- armsrc/iso15693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index 681f12b6d..190aa4ea9 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -1571,7 +1571,7 @@ int GetIso15693CommandFromReader(uint8_t *received, size_t max_len, uint32_t *eo break; } - if (data_available()) { + if (dr->state == STATE_READER_UNSYNCD && data_available()) { dr->byteCount = -2; break; }