RFID: Fix buffer size for writes
The RFID library expects a 16 bytes buffer for writing blocks. However, we re-use the 18 bytes buffer needed for reading blocks. Properly remove those two extra bytes when writing blocks.
This commit is contained in:
parent
5618f52a0e
commit
c92c8ce11f
1 changed files with 2 additions and 1 deletions
|
@ -161,7 +161,8 @@ bool RFID::writeBlock(MFRC522Constants::Uid &uidToRead, byte blockAddr, uint8_t
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte size = sizeof(comData);
|
// Take into account the two bytes used only for the read commands.
|
||||||
|
byte size = sizeof(comData) - 2;
|
||||||
for (byte& bufferByte: comData)
|
for (byte& bufferByte: comData)
|
||||||
bufferByte = 0;
|
bufferByte = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue