fix coverity 267211 & 267206 logically dead code

This commit is contained in:
Philippe Teuwen 2020-05-14 01:01:48 +02:00
commit 1c8c1d82ea
2 changed files with 22 additions and 13 deletions

View file

@ -1397,21 +1397,23 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
uint8_t attempt_count = 0;
// Tag specific configuration settings (sof, timings, etc.)
if (htf < 10) {
// TODO HTS
/* if (htf <= HTS_LAST_CMD) {
// hitagS settings
t_wait_1 = 204;
t_wait_2 = 128;
flipped_bit = 0;
tag_size = 8;
DBG DbpString("Configured for hitagS reader");
} else if (htf < 20) {
} else */
if (htf <= HT1_LAST_CMD) {
// hitag1 settings
t_wait_1 = 204;
t_wait_2 = 128;
tag_size = 256;
flipped_bit = 0;
DBG DbpString("Configured for hitag1 reader");
} else if (htf < 30) {
} else if (htf <= HT2_LAST_CMD) {
// hitag2 settings
t_wait_1 = HITAG_T_WAIT_1_MIN;
t_wait_2 = HITAG_T_WAIT_2_MIN;
@ -1721,28 +1723,32 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
lf_init(true, false);
// Tag specific configuration settings (sof, timings, etc.)
if (htf < 10) {
// TODO HTS
/* if (htf <= HTS_LAST_CMD) {
// hitagS settings
t_wait_1 = 204;
t_wait_2 = 128;
/*tag_size = 256;*/
//tag_size = 256;
flipped_bit = 0;
tag_size = 8;
DbpString("Configured for hitagS writer");
} else if (htf < 20) {
} else */
// TODO HT1
/* if (htf <= HT1_LAST_CMD) {
// hitag1 settings
t_wait_1 = 204;
t_wait_2 = 128;
tag_size = 256;
flipped_bit = 0;
DbpString("Configured for hitag1 writer");
} else if (htf < 30) {
// hitag2 settings
t_wait_1 = HITAG_T_WAIT_1_MIN;
t_wait_2 = HITAG_T_WAIT_2_MIN;
tag_size = 48;
DbpString("Configured for hitag2 writer");
}
} else */
// if (htf <= HT2_LAST_CMD) {
// hitag2 settings
t_wait_1 = HITAG_T_WAIT_1_MIN;
t_wait_2 = HITAG_T_WAIT_2_MIN;
tag_size = 48;
DbpString("Configured for hitag2 writer");
// }
uint8_t tag_modulation;
size_t max_nrzs = (8 * HITAG_FRAME_LEN + 5) * 2; // up to 2 nrzs per bit

View file

@ -21,8 +21,10 @@ typedef enum {
RHTSF_KEY = 02,
WHTSF_CHALLENGE = 03,
WHTSF_KEY = 04,
HTS_LAST_CMD = WHTSF_KEY,
RHT1F_PLAIN = 11,
RHT1F_AUTHENTICATE = 12,
HT1_LAST_CMD = RHT1F_AUTHENTICATE,
RHT2F_PASSWORD = 21,
RHT2F_AUTHENTICATE = 22,
RHT2F_CRYPTO = 23,
@ -30,6 +32,7 @@ typedef enum {
RHT2F_TEST_AUTH_ATTEMPTS = 25,
RHT2F_UID_ONLY = 26,
WHT2F_PASSWORD = 27,
HT2_LAST_CMD = WHT2F_PASSWORD,
} hitag_function;
typedef struct {