pn53x_reset_settings() now resets CRC, parity, easyframing and crypto1.

These settings are quite specifics and should be reset in other functions that call pn53x_reset_settings() too: i.e. nfc_initiator_init_secure_element()
This commit is contained in:
Romuald Conty 2012-06-12 16:46:20 +00:00
parent 4b5b45f14a
commit ab312299d6
2 changed files with 12 additions and 12 deletions

View file

@ -129,6 +129,18 @@ pn53x_reset_settings(struct nfc_device *pnd)
if ((res = pn53x_write_register(pnd, PN53X_REG_CIU_BitFraming, SYMBOL_TX_LAST_BITS, 0x00)) < 0) {
return res;
}
// Make sure we reset the CRC and parity to chip handling.
if ((res = pn53x_set_property_bool(pnd, NP_HANDLE_CRC, true)) < 0)
return res;
if ((res = pn53x_set_property_bool(pnd, NP_HANDLE_PARITY, true)) < 0)
return res;
// Activate "easy framing" feature by default
if ((res = pn53x_set_property_bool(pnd, NP_EASY_FRAMING, true)) < 0)
return res;
// Deactivate the CRYPTO1 cipher, it may could cause problems when still active
if ((res = pn53x_set_property_bool(pnd, NP_ACTIVATE_CRYPTO1, false)) < 0)
return res;
return NFC_SUCCESS;
}

View file

@ -363,18 +363,6 @@ nfc_initiator_init(nfc_device *pnd)
// Disallow multiple frames
if ((res = nfc_device_set_property_bool(pnd, NP_ACCEPT_MULTIPLE_FRAMES, false)) < 0)
return res;
// Make sure we reset the CRC and parity to chip handling.
if ((res = nfc_device_set_property_bool(pnd, NP_HANDLE_CRC, true)) < 0)
return res;
if ((res = nfc_device_set_property_bool(pnd, NP_HANDLE_PARITY, true)) < 0)
return res;
// Activate "easy framing" feature by default
if ((res = nfc_device_set_property_bool(pnd, NP_EASY_FRAMING, true)) < 0)
return res;
// Deactivate the CRYPTO1 cipher, it may could cause problems when still active
if ((res = nfc_device_set_property_bool(pnd, NP_ACTIVATE_CRYPTO1, false)) < 0)
return res;
HAL(initiator_init, pnd);
}