Massimo Manca

NFCRdLib bug found

Discussion created by Massimo Manca on Sep 5, 2017
Latest reply on Sep 8, 2017 by IvanRuiz

At row 871 in phNfcLib.c I found a bug, this is my proposed solution:

 

#if 0 // [MM] Warning[Pe063]: shift count is too large C:\Users\mmanca\My Documents\Projects\NFC\NfcFrontendsTest\NFCLibNXP\comps\phNfcLib\src\phNfcLib.c 877
sak_atqa = (uint32_t)((gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aSak << 16U) |
(gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aAtqa[0] << 8U) |
(gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aAtqa[1]));
#else
sak_atqa = (uint32_t)(((uint32_t)(gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aSak) << 16UL) |
((uint32_t)(gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aAtqa[0]) << 8UL) |
(uint32_t)(gphNfcLib_Params.sDiscLoop.sTypeATargetInfo.aTypeA_I3P3[0].aAtqa[1]));
#endif

Outcomes