From 764cb6c25101947ad02ece3b1200d4f7a52dfe98 Mon Sep 17 00:00:00 2001 From: tuyethoa08041997 Date: Sat, 13 Jan 2018 18:15:12 +0700 Subject: [PATCH] Fix wrong var names in PICC_Select, MFRC522.cpp (#301) fix issue #238 --- src/MFRC522.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MFRC522.cpp b/src/MFRC522.cpp index 4287a2b..fc6edf9 100644 --- a/src/MFRC522.cpp +++ b/src/MFRC522.cpp @@ -736,10 +736,10 @@ MFRC522::StatusCode MFRC522::PICC_Select( Uid *uid, ///< Pointer to Uid struct return STATUS_INTERNAL_ERROR; } // Choose the PICC with the bit set. - currentLevelKnownBits = collisionPos; - count = (currentLevelKnownBits - 1) % 8; // The bit to modify - index = 1 + (currentLevelKnownBits / 8) + (count ? 1 : 0); // First byte is index 0. + count = (collisionPos - 1) % 8; // The bit to modify + index = 1 + ((collisionPos - 1) / 8) + (count ? 1 : 0); // First byte is index 0. buffer[index] |= (1 << count); + currentLevelKnownBits = collisionPos; } else if (result != STATUS_OK) { return result;