From 90b8a31ebad04f60c1d2bc66cb5fc946f4d6ce44 Mon Sep 17 00:00:00 2001 From: Menci Date: Sat, 27 Jul 2024 10:00:06 +0800 Subject: [PATCH] [F] Fix waiting too long in loop caused by unlimited retries --- CardReader/src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CardReader/src/main.cpp b/CardReader/src/main.cpp index 325bdfc..f59e09e 100644 --- a/CardReader/src/main.cpp +++ b/CardReader/src/main.cpp @@ -53,7 +53,7 @@ void setup() // Set the max number of retry attempts to read from a card // This prevents us from waiting forever for a card, which is the default behaviour of the PN532. - nfc.setPassiveActivationRetries(0xFF); + nfc.setPassiveActivationRetries(1); nfc.SAMConfig(); // Clear the IDm buffer @@ -111,13 +111,13 @@ void loop() // When one is found, some basic information such as IDm, PMm, and System Code are retrieved. leds[0] = CRGB::BlueViolet; FastLED.show(); - if (nfc.felica_Polling(0xFFFF, 0x00, idm, pmm, &systemCode, 5) == 1) + if (nfc.felica_Polling(0xFFFF, 0x00, idm, pmm, &systemCode) == 1) foundCard(idm, UID_LENGTH, "FeliCa"); // Wait for an ISO14443A type cards (MIFARE, etc.). When one is found u8 uidLength; leds[0] = CRGB::OrangeRed; FastLED.show(); - if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, idm, &uidLength, 5) == 1) + if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, idm, &uidLength) == 1) foundCard(idm, uidLength, "ISO14443A"); }