mirror of
https://github.com/whowechina/aic_pico.git
synced 2024-12-02 16:57:15 +01:00
Filter out false card ids from faulty module
This commit is contained in:
parent
cae146ec96
commit
01b141db53
Binary file not shown.
@ -199,6 +199,15 @@ static void cardio_run()
|
|||||||
nfc_card_t card = nfc_detect_card();
|
nfc_card_t card = nfc_detect_card();
|
||||||
nfc_rf_field(false);
|
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) {
|
if (memcmp(&old_card, &card, sizeof(old_card)) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user