From 9d7369e23418f80690ceff4c9df45b7e18382105 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 2 Nov 2009 17:06:55 +0000 Subject: [PATCH] Fix Issue 45: nfc_target_init doesn't correctly reset the parity during initalization. Thanks to Mike Auty. --- src/libnfc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libnfc.c b/src/libnfc.c index 22c3e98..7be8e43 100644 --- a/src/libnfc.c +++ b/src/libnfc.c @@ -832,7 +832,7 @@ bool nfc_target_init(const dev_info* pdi, byte_t* pbtRx, size_t* pszRxBits) // Make sure the CRC & parity are handled by the device, this is needed for target_init to work properly if (!bCrc) nfc_configure((dev_info*)pdi,DCO_HANDLE_CRC,true); - if (!bPar) nfc_configure((dev_info*)pdi,DCO_HANDLE_CRC,true); + if (!bPar) nfc_configure((dev_info*)pdi,DCO_HANDLE_PARITY,true); // Let the PN53X be activated by the RF level detector from power down mode if (!pn53x_set_reg(pdi,REG_CIU_TX_AUTO, SYMBOL_INITIAL_RF_ON,0x04)) return false; @@ -852,7 +852,7 @@ bool nfc_target_init(const dev_info* pdi, byte_t* pbtRx, size_t* pszRxBits) // Restore the CRC & parity setting to the original value (if needed) if (!bCrc) nfc_configure((dev_info*)pdi,DCO_HANDLE_CRC,false); - if (!bPar) nfc_configure((dev_info*)pdi,DCO_HANDLE_CRC,false); + if (!bPar) nfc_configure((dev_info*)pdi,DCO_HANDLE_PARITY,false); return true; }