mirror of
https://github.com/esphome/esphome.git
synced 2025-01-10 14:43:17 +01:00
Version retry (fixes esphome/issues#3823) (#4651)
This commit is contained in:
parent
99638190cb
commit
fbc129cccc
1 changed files with 6 additions and 3 deletions
|
@ -18,11 +18,14 @@ void PN532::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up PN532...");
|
ESP_LOGCONFIG(TAG, "Setting up PN532...");
|
||||||
|
|
||||||
// Get version data
|
// Get version data
|
||||||
|
if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) {
|
||||||
|
ESP_LOGW(TAG, "Error sending version command, trying again...");
|
||||||
if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) {
|
if (!this->write_command_({PN532_COMMAND_VERSION_DATA})) {
|
||||||
ESP_LOGE(TAG, "Error sending version command");
|
ESP_LOGE(TAG, "Error sending version command");
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<uint8_t> version_data;
|
std::vector<uint8_t> version_data;
|
||||||
if (!this->read_response(PN532_COMMAND_VERSION_DATA, version_data)) {
|
if (!this->read_response(PN532_COMMAND_VERSION_DATA, version_data)) {
|
||||||
|
|
Loading…
Reference in a new issue