1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 00:02:21 +01:00

Add IDF 5 test yaml, add adc to IDF tests, fix adc for IDF 5 (#5379)

This commit is contained in:
Keith Burzinski
2023-09-12 18:36:17 -05:00
committed by GitHub
parent b8fa737bc9
commit 736dbfac13
4 changed files with 708 additions and 1 deletions

View File

@@ -62,8 +62,12 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
adc1_channel_t channel1_{ADC1_CHANNEL_MAX};
adc2_channel_t channel2_{ADC2_CHANNEL_MAX};
bool autorange_{false};
#if ESP_IDF_VERSION_MAJOR >= 5
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM] = {};
#else
esp_adc_cal_characteristics_t cal_characteristics_[ADC_ATTEN_MAX] = {};
#endif
#endif
};
} // namespace adc