1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-07 05:30:54 +00:00

[esp32_touch] Fix deprecated warning (#8092)

Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
This commit is contained in:
Jonathan Swoboda 2025-01-20 22:17:32 -05:00 committed by GitHub
parent 716a8b87e1
commit db644542ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,12 @@ void ESP32TouchComponent::setup() {
}
#endif
#if ESP_IDF_VERSION_MAJOR >= 5
touch_pad_set_measurement_clock_cycles(this->meas_cycle_);
touch_pad_set_measurement_interval(this->sleep_cycle_);
#else
touch_pad_set_meas_time(this->sleep_cycle_, this->meas_cycle_);
#endif
touch_pad_set_voltage(this->high_voltage_reference_, this->low_voltage_reference_, this->voltage_attenuation_);
for (auto *child : this->children_) {