pn53x: avoid mix of hardcoded/sizeof values
This commit is contained in:
parent
eca47b3cff
commit
ba4c920af7
1 changed files with 2 additions and 2 deletions
|
@ -988,7 +988,7 @@ pn53x_TgInitAsTarget (nfc_device_t * pnd, nfc_target_mode_t ntm, byte_t * pbtRx,
|
||||||
memcpy (abtCmd, pncmd_target_init, sizeof (pncmd_target_init));
|
memcpy (abtCmd, pncmd_target_init, sizeof (pncmd_target_init));
|
||||||
|
|
||||||
// Clear the target init struct, reset to all zeros
|
// Clear the target init struct, reset to all zeros
|
||||||
memset (abtCmd + 2, 0x00, 37);
|
memset (abtCmd + 2, 0x00, sizeof (pncmd_target_init)-2);
|
||||||
|
|
||||||
// Store the target mode in the initialization params
|
// Store the target mode in the initialization params
|
||||||
abtCmd[2] = ntm;
|
abtCmd[2] = ntm;
|
||||||
|
@ -1007,7 +1007,7 @@ pn53x_TgInitAsTarget (nfc_device_t * pnd, nfc_target_mode_t ntm, byte_t * pbtRx,
|
||||||
|
|
||||||
// Request the initialization as a target
|
// Request the initialization as a target
|
||||||
szRxLen = MAX_FRAME_LEN;
|
szRxLen = MAX_FRAME_LEN;
|
||||||
if (!pn53x_transceive (pnd, abtCmd, 39, abtRx, &szRxLen))
|
if (!pn53x_transceive (pnd, abtCmd, sizeof (pncmd_target_init), abtRx, &szRxLen))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Save the received byte count
|
// Save the received byte count
|
||||||
|
|
Loading…
Add table
Reference in a new issue