Skip to content

Commit 706d757

Browse files
committed
fix compile errors for esp32
1 parent 7a389b4 commit 706d757

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/esp32/esp32-hal-dac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ void IRAM_ATTR __dacWrite(uint8_t pin, uint8_t value)
3838
}
3939
pinMode(pin, ANALOG);
4040
uint8_t channel = pin - DAC1;
41+
#if CONFIG_IDF_TARGET_ESP32
42+
CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_SW_TONE_EN);
43+
#elif CONFIG_IDF_TARGET_ESP32S2
4144
SENS.sar_dac_ctrl1.dac_clkgate_en = 1;
45+
#endif
4246
RTCIO.pad_dac[channel].dac_xpd_force = 1;
4347
RTCIO.pad_dac[channel].xpd_dac = 1;
4448
if (channel == 0) {

cores/esp32/esp32-hal-gpio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ extern void IRAM_ATTR __pinMode(uint8_t pin, uint8_t mode)
169169
if(!rtc_reg) {
170170
return;//not rtc pin
171171
}
172+
#if CONFIG_IDF_TARGET_ESP32S2
172173
SENS.sar_io_mux_conf.iomux_clk_gate_en = 1;
174+
#endif
173175
SET_PERI_REG_MASK(rtc_io_desc[pin].reg, (rtc_io_desc[pin].mux));
174176
SET_PERI_REG_BITS(rtc_io_desc[pin].reg, RTC_IO_TOUCH_PAD1_FUN_SEL_V, SOC_PIN_FUNC_RTC_IO, rtc_io_desc[pin].func);
175177

0 commit comments

Comments
 (0)