1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-01 00:08:15 +00:00

Initialize default_vref to 1100mV

To keep consistency with v4 and avoid another warning on ESP32 standard.
This commit is contained in:
Edward Firmo 2024-12-11 23:55:30 +01:00
parent cd84dea671
commit 77e98d15fb

View File

@ -77,6 +77,9 @@ void ADCSensor::setup() {
.unit_id = unit_id, .unit_id = unit_id,
.atten = this->attenuation_, .atten = this->attenuation_,
.bitwidth = ADC_BITWIDTH_DEFAULT, .bitwidth = ADC_BITWIDTH_DEFAULT,
#if !defined(USE_ESP32_VARIANT_ESP32S2)
.default_vref = 1100, // Initialize default_vref to 1100mV
#endif // not USE_ESP32_VARIANT_ESP32S2
}; };
if (adc_cali_create_scheme_line_fitting(&cali_config, &handle) == ESP_OK) { if (adc_cali_create_scheme_line_fitting(&cali_config, &handle) == ESP_OK) {
this->calibration_handle_ = handle; this->calibration_handle_ = handle;