Skip to content

Commit d45984b

Browse files
authored
Merge pull request #79 from tasmota/revert-78-ADC_esp32s2_attenuation_fix
Revert "ADC esp32s2 attenuation fix for DAC pins"
2 parents 5fd4a6b + 3d03b5d commit d45984b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cores/esp32/esp32-hal-adc.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "soc/rtc_io_reg.h"
2828
#include "esp32/rom/ets_sys.h"
2929
#include "esp_intr_alloc.h"
30-
#include "soc/dac_channel.h"
3130
#define DEFAULT_VREF 1100
3231
static esp_adc_cal_characteristics_t *__analogCharacteristics[2] = {NULL, NULL};
3332
static uint16_t __analogVRef = 0;
@@ -39,8 +38,7 @@ static uint8_t __analogVRefPin = 0;
3938
#elif CONFIG_IDF_TARGET_ESP32S3
4039
#include "esp32s3/rom/ets_sys.h"
4140
#include "soc/sens_reg.h"
42-
#include "soc/rtc_io_reg.h
43-
#include "soc/dac_channel.h"
41+
#include "soc/rtc_io_reg.h"
4442
#elif CONFIG_IDF_TARGET_ESP32C3
4543
#include "esp32c3/rom/ets_sys.h"
4644
#else
@@ -148,9 +146,9 @@ bool __adcAttachPin(uint8_t pin){
148146
#endif
149147
}
150148
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
151-
else if(pin == DAC_CHANNEL_1_GPIO_NUM){
149+
else if(pin == 25){
152150
CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_XPD_DAC | RTC_IO_PDAC1_DAC_XPD_FORCE);//stop dac1
153-
} else if(pin == DAC_CHANNEL_2_GPIO_NUM){
151+
} else if(pin == 26){
154152
CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_XPD_DAC | RTC_IO_PDAC2_DAC_XPD_FORCE);//stop dac2
155153
}
156154
#endif

0 commit comments

Comments
 (0)