NfcAuthenticator: Reset PCD every read
Sometimes PCD driver would hang, causing inability to read NFC keys. This is to fix the issue, increasing loop time only slightly.
This commit is contained in:
parent
51ce0872bb
commit
40ddf07c00
|
@ -8,7 +8,6 @@ NfcAuthenticator::NfcAuthenticator(int nfcSlaveSelectPin, int nfcResetPin, const
|
|||
logger(logger)
|
||||
{
|
||||
SPI.begin();
|
||||
rfid.PCD_Init();
|
||||
}
|
||||
|
||||
NfcAuthenticator::~NfcAuthenticator()
|
||||
|
@ -29,6 +28,8 @@ Key NfcAuthenticator::getKey()
|
|||
|
||||
bool NfcAuthenticator::initializeCard()
|
||||
{
|
||||
rfid.PCD_Init();
|
||||
|
||||
if (!rfid.PICC_IsNewCardPresent())
|
||||
return false;
|
||||
|
||||
|
|
Reference in New Issue