mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
RC522 - Fix error counter error (#5873)
This commit is contained in:
parent
7fd08fb816
commit
89d7cdf86b
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue