Skip to content

Commit 689c78e

Browse files
committed
Adjust adc and pin init for esp-idf v4.4
1 parent 86dd709 commit 689c78e

File tree

1 file changed

+4
-4
lines changed
  • components/display/touch_panel/res4w

1 file changed

+4
-4
lines changed

components/display/touch_panel/res4w/res4w.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ static void set_yp_high(void)
192192
static uint32_t set_yp_input(void)
193193
{
194194
uint32_t retval = 0;
195-
// Initialise ESP32 internal ADC
196-
adc_gpio_init(g_dev.io_YP_ADC, g_dev.io_YP_CH);
195+
// Reset pin to high impedance (it may be configured as an output and driven high)
196+
gpio_reset_pin(g_dev.io_YP);
197197
// For ESP32 internal ADC's, the Full Scale voltage depends on the configured attenuation.
198198
// I use 11dB attentuation to get a full scale voltage of 3.9V
199199
if (ADC_UNIT_1 == g_dev.io_YP_ADC) {
@@ -268,8 +268,8 @@ static void set_xm_low(void)
268268
static uint32_t set_xm_input(void)
269269
{
270270
uint32_t retval = 0;
271-
// Initialise ESP32 internal ADC
272-
adc_gpio_init(g_dev.io_XM_ADC, g_dev.io_XM_CH);
271+
// Reset pin to high impedance (it may be configured as an output and driven low)
272+
gpio_reset_pin(g_dev.io_XM);
273273
// For ESP32 internal ADC's, the Full Scale voltage depends on the configured attenuation.
274274
// I use 11dB attentuation to get a full scale voltage of 3.9V
275275
if (ADC_UNIT_1 == g_dev.io_XM_ADC) {

0 commit comments

Comments
 (0)