Skip to content

Commit f9e3711

Browse files
author
Arbi Gunbardhi
committed
Removed multiple return statement in CheckChipID function
1 parent ca5bcf4 commit f9e3711

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

src/st25r3916.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,12 @@ bool RfalRfST25R3916Class::st25r3916CheckChipID(uint8_t *rev)
483483

484484
const uint8_t chipId = id & ST25R3916_REG_IC_IDENTITY_ic_type_mask;
485485

486-
const bool isChipIdValid =
487-
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 ||
488-
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b;
489-
490-
if (!isChipIdValid) {
491-
return false;
492-
}
493-
494486
if (rev) {
495487
*rev = (id & ST25R3916_REG_IC_IDENTITY_ic_rev_mask);
496488
}
497489

498-
return true;
490+
return (chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 ||
491+
chipId == ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b);
499492
}
500493

501494
/*******************************************************************************/

src/st25r3916_com.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@
974974
#define ST25R3916_REG_IC_IDENTITY_ic_type1 (1U<<4)
975975
#define ST25R3916_REG_IC_IDENTITY_ic_type0 (1U<<3)
976976
#define ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 (5U<<3)
977+
#define ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916b (6U<<3)
977978
#define ST25R3916_REG_IC_IDENTITY_ic_type_mask (0x1fU<<3)
978979
#define ST25R3916_REG_IC_IDENTITY_ic_type_shift (3U)
979980
#define ST25R3916_REG_IC_IDENTITY_ic_rev2 (1U<<2)

0 commit comments

Comments
 (0)