Skip to content

Commit ec538dd

Browse files
committed
chore: update basic example
1 parent 92d2cb2 commit ec538dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/basic/main/basic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ static void on_picc_state_changed(void *arg, esp_event_base_t base, int32_t even
3333
rc522_picc_t *picc = event->picc;
3434

3535
if (picc->state == RC522_PICC_STATE_ACTIVE) {
36+
ESP_LOGI(TAG, "Card has been detected");
3637
rc522_picc_print(picc);
3738
}
38-
else if (picc->state == RC522_PICC_STATE_IDLE && event->old_state >= RC522_PICC_STATE_ACTIVE) {
39+
else if (picc->state == RC522_PICC_STATE_IDLE) {
3940
ESP_LOGI(TAG, "Card has been removed");
41+
rc522_picc_print(picc);
4042
}
4143
}
4244

0 commit comments

Comments
 (0)