From eec79bd3b28dbf6a0f404347abb142c0e8ca68f9 Mon Sep 17 00:00:00 2001 From: Wouter Van Hoof Date: Mon, 19 Dec 2022 21:47:19 +0100 Subject: [PATCH 1/3] Fix typo in pin define of adcraw --- lvgl_touch/adcraw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvgl_touch/adcraw.h b/lvgl_touch/adcraw.h index 5015d12d..b16d519f 100644 --- a/lvgl_touch/adcraw.h +++ b/lvgl_touch/adcraw.h @@ -19,7 +19,7 @@ extern "C" { #include "lvgl/lvgl.h" #endif -#define TOUCHSCREEN_RESISTIVE_PIN_YU CONFIG_LV_TOUCHSCREEN_RESSITIVE_PIN_YU // Y+ any gpio +#define TOUCHSCREEN_RESISTIVE_PIN_YU CONFIG_LV_TOUCHSCREEN_RESISTIVE_PIN_YU // Y+ any gpio #define TOUCHSCREEN_RESISTIVE_PIN_YD CONFIG_LV_TOUCHSCREEN_RESISTIVE_PIN_YD // Y- also ADC #define TOUCHSCREEN_RESISTIVE_PIN_XL CONFIG_LV_TOUCHSCREEN_RESISTIVE_PIN_XL // X- any gpio #define TOUCHSCREEN_RESISTIVE_PIN_XR CONFIG_LV_TOUCHSCREEN_RESISTIVE_PIN_XR // X+ also ADC From 33ca7b739bc59ee4831dd20423f47d8b8702d3df Mon Sep 17 00:00:00 2001 From: Wouter Van Hoof Date: Mon, 19 Dec 2022 21:49:31 +0100 Subject: [PATCH 2/3] Include GPIO lookup macros header file --- lvgl_touch/adcraw.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lvgl_touch/adcraw.h b/lvgl_touch/adcraw.h index b16d519f..3996fb77 100644 --- a/lvgl_touch/adcraw.h +++ b/lvgl_touch/adcraw.h @@ -13,6 +13,7 @@ extern "C" { #include #include "driver/gpio.h" #include "driver/adc.h" +#include "soc/adc_channel.h" #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else From cfebeb7c054c919b04f98f0ff93fb0c652170b57 Mon Sep 17 00:00:00 2001 From: Wouter Van Hoof Date: Mon, 19 Dec 2022 21:54:43 +0100 Subject: [PATCH 3/3] Remove adc_gpio_init function Function is deprecated. Functionality is folded into the adc[1,2]_config_channel_atten() functions. https://www.esp32.com/viewtopic.php?t=25244 --- lvgl_touch/adcraw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lvgl_touch/adcraw.c b/lvgl_touch/adcraw.c index 6170b4c8..164067d4 100644 --- a/lvgl_touch/adcraw.c +++ b/lvgl_touch/adcraw.c @@ -158,7 +158,6 @@ static void setup_adc(gpio_num_t measure) { // Init ADC adc1_channel_t channel = gpio_to_adc[measure]; - adc_gpio_init(ADC_UNIT_1, channel); adc1_config_width(ADC_WIDTH_BIT_10); adc1_config_channel_atten(channel, ADC_ATTEN_DB_11); }