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); } diff --git a/lvgl_touch/adcraw.h b/lvgl_touch/adcraw.h index 5015d12d..3996fb77 100644 --- a/lvgl_touch/adcraw.h +++ b/lvgl_touch/adcraw.h @@ -13,13 +13,14 @@ 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 #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