@@ -146,7 +146,7 @@ void MFRC522::PCD_ClearRegisterBitMask(PCD_Register reg, byte mask) {
146
146
* @param result Out: Pointer to result buffer. Result is written to result[0..1], low byte first.
147
147
* @return STATUS_OK on success, STATUS_??? otherwise.
148
148
*/
149
- MFRC522::StatusCode MFRC522::PCD_CalculateCRC (byte * data, byte length, byte * result) {
149
+ MFRC522::StatusCode MFRC522::PCD_CalculateCRC (byte* data, byte length, byte* result) {
150
150
PCD_WriteRegister (CommandReg, PCD_Idle); // Stop any active command.
151
151
PCD_WriteRegister (DivIrqReg, 0x04 ); // Clear the CRCIRq interrupt request bit
152
152
PCD_WriteRegister (FIFOLevelReg, 0x80 ); // FlushBuffer = 1, FIFO initialization
@@ -160,7 +160,6 @@ MFRC522::StatusCode MFRC522::PCD_CalculateCRC(byte *data, byte length, byte *res
160
160
for (uint16_t i = 5000 ; i > 0 ; i--) {
161
161
// DivIrqReg[7..0] bits are: Set2 reserved reserved MfinActIRq reserved CRCIRq reserved reserved
162
162
byte n = PCD_ReadRegister (DivIrqReg);
163
- if (n & 0x04 ) { // CRCIRq bit set - calculation done
164
163
if (n & 0x04 ) { // CRCIRq bit set - calculation done
165
164
PCD_WriteRegister (CommandReg, PCD_Idle); // Stop calculating CRC for new content in the FIFO.
166
165
// Transfer the result from the registers to the result buffer
@@ -403,8 +402,8 @@ bool MFRC522::PCD_PerformSelfTest() {
403
402
* @param checkCRC In: True => The last two bytes of the response is assumed to be a CRC_A that must be validated.
404
403
* @return STATUS_OK on success, STATUS_??? otherwise.
405
404
*/
406
- byte waitIRq = 0x30 ; // RxIRq and IdleIRq
407
405
MFRC522::StatusCode MFRC522::PCD_TransceiveData (byte* sendData, byte sendLen, byte* backData, byte* backLen, byte* validBits, byte rxAlign, bool checkCRC) {
406
+ byte waitIRq = 0x30 ; // RxIRq and IdleIRq
408
407
return PCD_CommunicateWithPICC (PCD_Transceive, waitIRq, sendData, sendLen, backData, backLen, validBits, rxAlign, checkCRC);
409
408
} // End PCD_TransceiveData()
410
409
@@ -426,8 +425,8 @@ MFRC522::StatusCode MFRC522::PCD_TransceiveData(byte* sendData, byte sendLen, by
426
425
*/
427
426
MFRC522::StatusCode MFRC522::PCD_CommunicateWithPICC (byte command, byte waitIRq, byte* sendData, byte sendLen, byte* backData, byte* backLen, byte* validBits, byte rxAlign, bool checkCRC) {
428
427
// Prepare values for BitFramingReg
429
- byte bitFraming = (rxAlign << 4 ) + txLastBits; // RxAlign = BitFramingReg[6..4]. TxLastBits = BitFramingReg[2..0]
430
428
byte txLastBits = validBits ? *validBits : (byte) 0 ;
429
+ byte bitFraming = (rxAlign << 4 ) + txLastBits; // RxAlign = BitFramingReg[6..4]. TxLastBits = BitFramingReg[2..0]
431
430
432
431
PCD_WriteRegister (CommandReg, PCD_Idle); // Stop any active command.
433
432
PCD_WriteRegister (ComIrqReg, 0x7F ); // Clear all seven interrupt request bits
@@ -808,8 +807,8 @@ MFRC522::StatusCode MFRC522::PICC_HaltA() {
808
807
* @param uid Pointer to Uid struct. The first 4 bytes of the UID is used.
809
808
* @return STATUS_OK on success, STATUS_??? otherwise. Probably STATUS_TIMEOUT if you supply the wrong key.
810
809
*/
811
- byte waitIRq = 0x10 ; // IdleIRq
812
810
MFRC522::StatusCode MFRC522::PCD_Authenticate (byte command, byte blockAddr, MIFARE_Key* key, Uid* uid) {
811
+ byte waitIRq = 0x10 ; // IdleIRq
813
812
814
813
// Build command buffer
815
814
byte sendData[12 ];
0 commit comments