1
0
mirror of https://github.com/whowechina/aic_pico.git synced 2024-11-30 16:14:28 +01:00

Filter out false card ids from faulty module

This commit is contained in:
whowechina 2024-06-11 21:35:54 +08:00
parent cae146ec96
commit 01b141db53
2 changed files with 9 additions and 0 deletions

Binary file not shown.

View File

@ -199,6 +199,15 @@ static void cardio_run()
nfc_card_t card = nfc_detect_card();
nfc_rf_field(false);
/* Double check ID, some module gives random false data */
nfc_rf_field(true);
nfc_card_t card_confirm = nfc_detect_card();
nfc_rf_field(false);
if (memcmp(&card, &card_confirm, sizeof(card)) != 0) {
return;
}
if (memcmp(&old_card, &card, sizeof(old_card)) == 0) {
return;
}