Fix wrong var names in PICC_Select, MFRC522.cpp (#301)

fix issue #238
This commit is contained in:
tuyethoa08041997
2018-01-13 18:15:12 +07:00
committed by Rotzbua
parent 98c43cde8f
commit 764cb6c251

View File

@@ -736,10 +736,10 @@ MFRC522::StatusCode MFRC522::PICC_Select( Uid *uid, ///< Pointer to Uid struct
return STATUS_INTERNAL_ERROR; return STATUS_INTERNAL_ERROR;
} }
// Choose the PICC with the bit set. // Choose the PICC with the bit set.
currentLevelKnownBits = collisionPos; count = (collisionPos - 1) % 8; // The bit to modify
count = (currentLevelKnownBits - 1) % 8; // The bit to modify index = 1 + ((collisionPos - 1) / 8) + (count ? 1 : 0); // First byte is index 0.
index = 1 + (currentLevelKnownBits / 8) + (count ? 1 : 0); // First byte is index 0.
buffer[index] |= (1 << count); buffer[index] |= (1 << count);
currentLevelKnownBits = collisionPos;
} }
else if (result != STATUS_OK) { else if (result != STATUS_OK) {
return result; return result;