Skip to content

Commit

Permalink
move /8 outside of loop for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ljos committed Sep 25, 2013
1 parent 621246d commit 6724ed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MFRC522.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ int MFRC522::antiCollision(byte *serial) {
serial[0] = MF1_ANTICOLL;
serial[1] = 0x20;
status = commandTag(MFRC522_TRANSCEIVE, serial, 2, serial, &len);

len = len / 8; // len is in bits, and we want each byte.
if (status == MI_OK) {
// The checksum of the tag is the ^ of all the values.
for (i=0; i < (len/8)-1; i++) { // len is in bits, and we want each byte.
for (i = 0; i < len-1; i++) {
check ^= serial[i];
}
// The checksum should be the same as the one provided from the
Expand Down

0 comments on commit 6724ed0

Please sign in to comment.