mirror of
https://github.com/whowechina/aic_pico.git
synced 2025-03-03 08:36:38 +01:00
Fix autopin card timeout logic
This commit is contained in:
parent
de4c7eeecd
commit
0919c0fe2f
Binary file not shown.
@ -161,14 +161,19 @@ static void update_cardio(nfc_card_t *card)
|
||||
}
|
||||
|
||||
bool new_card = false;
|
||||
if ((card->len != last_card.uid_len) ||
|
||||
(memcmp(card->uid, last_card.uid, card->len) != 0)) {
|
||||
if ((card->len == last_card.uid_len) &&
|
||||
(memcmp(card->uid, last_card.uid, card->len) == 0)) {
|
||||
if (time_us_64() - last_card.time > LAST_CARD_TIMEOUT_US) {
|
||||
new_card = true;
|
||||
}
|
||||
} else {
|
||||
last_card.uid_len = card->len;
|
||||
memcpy(last_card.uid, card->uid, 8);
|
||||
new_card = true;
|
||||
}
|
||||
|
||||
last_card.time = time_us_64();
|
||||
|
||||
|
||||
check_autopin(new_card);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user