mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 00:18:11 +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;
|
back_length_ = 0;
|
||||||
ESP_LOGW(TAG, "Communication with the MFRC522 might be down, reset in %d",
|
ESP_LOGW(TAG, "Communication with the MFRC522 might be down, reset in %d",
|
||||||
10 - error_counter_); // todo: trigger reset?
|
10 - error_counter_); // todo: trigger reset?
|
||||||
if (error_counter_++ > 10)
|
if (error_counter_++ >= 10) {
|
||||||
setup();
|
setup();
|
||||||
|
error_counter_ = 0; // reset the error counter
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_TIMEOUT;
|
return STATUS_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue