mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-22 11:41:50 +00:00
chips/pn53x: drivers now uses pn53x_data_new() and pn53x_data_free() to handle strcut pn53x_data allocation, initialization and freeing.
This commit is contained in:
@@ -2467,3 +2467,12 @@ pn53x_data_new (nfc_device_t * pnd, const struct pn53x_io* io)
|
||||
CHIP_DATA (pnd)->wb_trigged = false;
|
||||
memset (CHIP_DATA (pnd)->wb_mask, 0x00, PN53X_CACHE_REGISTER_SIZE);
|
||||
}
|
||||
|
||||
void
|
||||
pn53x_data_free (nfc_device_t * pnd)
|
||||
{
|
||||
if (CHIP_DATA (pnd)->current_target) {
|
||||
free (CHIP_DATA (pnd)->current_target);
|
||||
}
|
||||
free (pnd->chip_data);
|
||||
}
|
||||
|
||||
@@ -337,5 +337,6 @@ bool pn53x_check_error_frame (nfc_device_t * pnd, const byte_t * pbtRxFrame,
|
||||
bool pn53x_build_frame (byte_t * pbtFrame, size_t * pszFrame, const byte_t * pbtData, const size_t szData);
|
||||
|
||||
void pn53x_data_new (nfc_device_t * pnd, const struct pn53x_io* io);
|
||||
void pn53x_data_free (nfc_device_t * pnd);
|
||||
|
||||
#endif // __NFC_CHIPS_PN53X_H__
|
||||
|
||||
Reference in New Issue
Block a user