Fixed simulation bug

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.
This commit is contained in:
Antiklesys
2026-04-06 15:06:09 +08:00
parent ab60ab41e6
commit fb8f94fa25

View File

@@ -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;
}