From ff20eb9c689a14a674029f2d72678aac16eeb3ec Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 19 Sep 2023 01:35:51 +0200 Subject: [PATCH] simplify anticol+ATS, my fault --- .../application/src/rfid/reader/hf/rc522.c | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/firmware/application/src/rfid/reader/hf/rc522.c b/firmware/application/src/rfid/reader/hf/rc522.c index aff574d4..7df90ec3 100644 --- a/firmware/application/src/rfid/reader/hf/rc522.c +++ b/firmware/application/src/rfid/reader/hf/rc522.c @@ -579,25 +579,25 @@ uint8_t pcd_14a_reader_scan_once(picc_14a_tag_t *tag) { // Only 1 2 3 Three types, corresponding 4 7 10 Byte card number // Therefore + 1 tag->cascade = cascade_level + 1; - if ((!do_cascade) && (tag->sak & 0x20)) { - // Tag supports 14443-4, sending RATS - uint16_t ats_size; - status = pcd_14a_reader_ats_request(tag->ats, &ats_size, 0xFF*8); - ats_size -= 2; // size returned by pcd_14a_reader_ats_request includes CRC - if (ats_size > 254) { - NRF_LOG_INFO("Invalid ATS > 254!"); - return HF_ERR_ATS; - } - tag->ats_len = ats_size; - // We do not validate ATS here as we want to report ATS as it is without breaking 14a scan - if (tag->ats[0] != ats_size - 1) { - NRF_LOG_INFO("Invalid ATS! First byte doesn't match received length"); - // return HF_ERR_ATS; - } - if (status != HF_TAG_OK) { - NRF_LOG_INFO("Tag SAK claimed to support ATS but tag NAKd RATS"); - // return HF_ERR_ATS; - } + } + if (tag->sak & 0x20) { + // Tag supports 14443-4, sending RATS + uint16_t ats_size; + status = pcd_14a_reader_ats_request(tag->ats, &ats_size, 0xFF*8); + ats_size -= 2; // size returned by pcd_14a_reader_ats_request includes CRC + if (ats_size > 254) { + NRF_LOG_INFO("Invalid ATS > 254!"); + return HF_ERR_ATS; + } + tag->ats_len = ats_size; + // We do not validate ATS here as we want to report ATS as it is without breaking 14a scan + if (tag->ats[0] != ats_size - 1) { + NRF_LOG_INFO("Invalid ATS! First byte doesn't match received length"); + // return HF_ERR_ATS; + } + if (status != HF_TAG_OK) { + NRF_LOG_INFO("Tag SAK claimed to support ATS but tag NAKd RATS"); + // return HF_ERR_ATS; } } return HF_TAG_OK;