mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
[ledc] Fix deprecated intr_type warning on ESP-IDF 6.0+
The intr_type field of ledc_channel_config_t was deprecated in ESP-IDF 6.0 as the driver now handles interrupts internally. Guard the assignment with a version check to silence the warning.
This commit is contained in:
@@ -193,7 +193,9 @@ void LEDCOutput::setup() {
|
||||
chan_conf.gpio_num = static_cast<gpio_num_t>(this->pin_->get_pin());
|
||||
chan_conf.speed_mode = speed_mode;
|
||||
chan_conf.channel = chan_num;
|
||||
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||
chan_conf.intr_type = LEDC_INTR_DISABLE;
|
||||
#endif
|
||||
chan_conf.timer_sel = timer_num;
|
||||
chan_conf.duty = this->inverted_ == this->pin_->is_inverted() ? 0 : (1U << this->bit_depth_);
|
||||
chan_conf.hpoint = hpoint;
|
||||
|
||||
Reference in New Issue
Block a user