RC522 - Fix error counter error (#5873)

This commit is contained in:
Keith Burzinski 2023-12-05 02:21:12 -06:00 committed by GitHub
parent 7fd08fb816
commit 89d7cdf86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -397,8 +397,10 @@ RC522::StatusCode RC522::await_transceive_() {
back_length_ = 0;
ESP_LOGW(TAG, "Communication with the MFRC522 might be down, reset in %d",
10 - error_counter_); // todo: trigger reset?
if (error_counter_++ > 10)
if (error_counter_++ >= 10) {
setup();
error_counter_ = 0; // reset the error counter
}
return STATUS_TIMEOUT;
}