Skip to content

Commit b7a4bb3

Browse files
wmrsouzaaescolar
authored andcommitted
drivers: adc: esp32: adc2 init code calibration
Add call to adc2_init_code_calibration during adc initialization on esp32s2 and esp32c3 Signed-off-by: Marcio Ribeiro <[email protected]>
1 parent e7e7386 commit b7a4bb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/adc/adc_esp32.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,12 @@ static int adc_esp32_init(const struct device *dev)
654654

655655
adc_hw_calibration(conf->unit);
656656

657+
#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3
658+
if (conf->unit == ADC_UNIT_2) {
659+
adc2_init_code_calibration();
660+
}
661+
#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */
662+
657663
#if defined(CONFIG_ADC_ESP32_DMA)
658664
if (!device_is_ready(conf->gpio_port)) {
659665
LOG_ERR("gpio0 port not ready");

0 commit comments

Comments
 (0)