diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c index a37633ba7db..152046ca0a7 100644 --- a/cores/esp32/esp32-hal-adc.c +++ b/cores/esp32/esp32-hal-adc.c @@ -27,7 +27,6 @@ #include "soc/rtc_io_reg.h" #include "esp32/rom/ets_sys.h" #include "esp_intr_alloc.h" -#include "soc/dac_channel.h" #define DEFAULT_VREF 1100 static esp_adc_cal_characteristics_t *__analogCharacteristics[2] = {NULL, NULL}; static uint16_t __analogVRef = 0; @@ -39,8 +38,7 @@ static uint8_t __analogVRefPin = 0; #elif CONFIG_IDF_TARGET_ESP32S3 #include "esp32s3/rom/ets_sys.h" #include "soc/sens_reg.h" -#include "soc/rtc_io_reg.h -#include "soc/dac_channel.h" +#include "soc/rtc_io_reg.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rom/ets_sys.h" #else @@ -148,9 +146,9 @@ bool __adcAttachPin(uint8_t pin){ #endif } #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 - else if(pin == DAC_CHANNEL_1_GPIO_NUM){ + else if(pin == 25){ CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_XPD_DAC | RTC_IO_PDAC1_DAC_XPD_FORCE);//stop dac1 - } else if(pin == DAC_CHANNEL_2_GPIO_NUM){ + } else if(pin == 26){ CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_XPD_DAC | RTC_IO_PDAC2_DAC_XPD_FORCE);//stop dac2 } #endif