mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 08:46:01 +00:00
[remote_receiver, remote_transmitter] Improve error messages on the ESP32 (#6701)
This commit is contained in:
@@ -23,7 +23,8 @@ void RemoteTransmitterComponent::dump_config() {
|
||||
}
|
||||
|
||||
if (this->is_failed()) {
|
||||
ESP_LOGE(TAG, "Configuring RMT driver failed: %s", esp_err_to_name(this->error_code_));
|
||||
ESP_LOGE(TAG, "Configuring RMT driver failed: %s (%s)", esp_err_to_name(this->error_code_),
|
||||
this->error_string_.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +57,7 @@ void RemoteTransmitterComponent::configure_rmt_() {
|
||||
esp_err_t error = rmt_config(&c);
|
||||
if (error != ESP_OK) {
|
||||
this->error_code_ = error;
|
||||
this->error_string_ = "in rmt_config";
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
@@ -64,6 +66,11 @@ void RemoteTransmitterComponent::configure_rmt_() {
|
||||
error = rmt_driver_install(this->channel_, 0, 0);
|
||||
if (error != ESP_OK) {
|
||||
this->error_code_ = error;
|
||||
if (error == ESP_ERR_INVALID_STATE) {
|
||||
this->error_string_ = str_sprintf("RMT channel %i is already in use by another component", this->channel_);
|
||||
} else {
|
||||
this->error_string_ = "in rmt_driver_install";
|
||||
}
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user