File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 27
27
#include "soc/rtc_io_reg.h"
28
28
#include "esp32/rom/ets_sys.h"
29
29
#include "esp_intr_alloc.h"
30
+ #include "soc/dac_channel.h"
30
31
#define DEFAULT_VREF 1100
31
32
static esp_adc_cal_characteristics_t * __analogCharacteristics [2 ] = {NULL , NULL };
32
33
static uint16_t __analogVRef = 0 ;
@@ -35,6 +36,7 @@ static uint8_t __analogVRefPin = 0;
35
36
#include "esp32s2/rom/ets_sys.h"
36
37
#include "soc/sens_reg.h"
37
38
#include "soc/rtc_io_reg.h"
39
+ #include "soc/dac_channel.h"
38
40
#elif CONFIG_IDF_TARGET_ESP32C3
39
41
#include "esp32c3/rom/ets_sys.h"
40
42
#else
@@ -141,10 +143,10 @@ bool __adcAttachPin(uint8_t pin){
141
143
}
142
144
#endif
143
145
}
144
- #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
145
- else if (pin == 25 ){
146
+ #if SOC_DAC_SUPPORTED
147
+ else if (pin == DAC_CHANNEL_1_GPIO_NUM ){
146
148
CLEAR_PERI_REG_MASK (RTC_IO_PAD_DAC1_REG , RTC_IO_PDAC1_XPD_DAC | RTC_IO_PDAC1_DAC_XPD_FORCE );//stop dac1
147
- } else if (pin == 26 ){
149
+ } else if (pin == DAC_CHANNEL_2_GPIO_NUM ){
148
150
CLEAR_PERI_REG_MASK (RTC_IO_PAD_DAC2_REG , RTC_IO_PDAC2_XPD_DAC | RTC_IO_PDAC2_DAC_XPD_FORCE );//stop dac2
149
151
}
150
152
#endif
You can’t perform that action at this time.
0 commit comments