@@ -232,11 +232,11 @@ void MFRC522::PCD_Reset() {
|
|||||||
// The datasheet does not mention how long the SoftRest command takes to complete.
|
// The datasheet does not mention how long the SoftRest command takes to complete.
|
||||||
// But the MFRC522 might have been in soft power-down mode (triggered by bit 4 of CommandReg)
|
// But the MFRC522 might have been in soft power-down mode (triggered by bit 4 of CommandReg)
|
||||||
// Section 8.8.2 in the datasheet says the oscillator start-up time is the start up time of the crystal + 37,74μs. Let us be generous: 50ms.
|
// Section 8.8.2 in the datasheet says the oscillator start-up time is the start up time of the crystal + 37,74μs. Let us be generous: 50ms.
|
||||||
delay(50);
|
uint8_t count = 0;
|
||||||
// Wait for the PowerDown bit in CommandReg to be cleared
|
do {
|
||||||
while (PCD_ReadRegister(CommandReg) & (1<<4)) {
|
// Wait for the PowerDown bit in CommandReg to be cleared (max 3x50ms)
|
||||||
// PCD still restarting - unlikely after waiting 50ms, but better safe than sorry.
|
delay(50);
|
||||||
}
|
} while ((PCD_ReadRegister(CommandReg) & (1 << 4)) && (++count) < 3);
|
||||||
} // End PCD_Reset()
|
} // End PCD_Reset()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user