Version retry (fixes esphome/issues#3823) (#4651)

This commit is contained in:
tracestep 2023-04-03 19:23:31 -03:00 committed by GitHub
parent 99638190cb
commit fbc129cccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,9 +19,12 @@ void PN532::setup() {
// Get version data // Get version data
if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) { if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) {
ESP_LOGE(TAG, "Error sending version command"); ESP_LOGW(TAG, "Error sending version command, trying again...");
this->mark_failed(); if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) {
return; ESP_LOGE(TAG, "Error sending version command");
this->mark_failed();
return;
}
} }
std::vector<uint8_t> version_data; std::vector<uint8_t> version_data;