mirror of
https://github.com/esphome/esphome.git
synced 2026-03-23 22:37:31 +08:00
[esp32_rmt_led_strip][remote_transmitter][remote_receiver] Fix ESP-IDF 6.0 RMT compatibility (#14783)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -99,8 +99,6 @@ void ESP32RMTLEDStripLightOutput::setup() {
|
||||
channel.gpio_num = gpio_num_t(this->pin_);
|
||||
channel.mem_block_symbols = this->rmt_symbols_;
|
||||
channel.trans_queue_depth = 1;
|
||||
channel.flags.io_loop_back = 0;
|
||||
channel.flags.io_od_mode = 0;
|
||||
channel.flags.invert_out = this->invert_out_;
|
||||
channel.flags.with_dma = this->use_dma_;
|
||||
channel.intr_priority = 0;
|
||||
|
||||
@@ -44,7 +44,6 @@ void RemoteReceiverComponent::setup() {
|
||||
channel.intr_priority = 0;
|
||||
channel.flags.invert_in = 0;
|
||||
channel.flags.with_dma = this->with_dma_;
|
||||
channel.flags.io_loop_back = 0;
|
||||
esp_err_t error = rmt_new_rx_channel(&channel, &this->channel_);
|
||||
if (error != ESP_OK) {
|
||||
this->error_code_ = error;
|
||||
|
||||
@@ -120,11 +120,13 @@ void RemoteTransmitterComponent::configure_rmt_() {
|
||||
channel.gpio_num = gpio_num_t(this->pin_->get_pin());
|
||||
channel.mem_block_symbols = this->rmt_symbols_;
|
||||
channel.trans_queue_depth = 1;
|
||||
channel.flags.io_loop_back = open_drain;
|
||||
channel.flags.io_od_mode = open_drain;
|
||||
channel.flags.invert_out = 0;
|
||||
channel.flags.with_dma = this->with_dma_;
|
||||
channel.intr_priority = 0;
|
||||
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||
channel.flags.io_loop_back = open_drain;
|
||||
channel.flags.io_od_mode = open_drain;
|
||||
#endif
|
||||
error = rmt_new_tx_channel(&channel, &this->channel_);
|
||||
if (error != ESP_OK) {
|
||||
this->error_code_ = error;
|
||||
@@ -136,6 +138,13 @@ void RemoteTransmitterComponent::configure_rmt_() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||
if (open_drain) {
|
||||
gpio_num_t gpio = gpio_num_t(this->pin_->get_pin());
|
||||
gpio_od_enable(gpio);
|
||||
gpio_input_enable(gpio);
|
||||
}
|
||||
#endif
|
||||
if (this->pin_->get_flags() & gpio::FLAG_PULLUP) {
|
||||
gpio_pullup_en(gpio_num_t(this->pin_->get_pin()));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user