From f1b5f72109d7c295cca4a4a504f595178f3a6485 Mon Sep 17 00:00:00 2001 From: Ivan Correa Date: Mon, 15 May 2023 11:52:15 -0300 Subject: [PATCH] ft5x06: Fix initialization of RST and INT pins * fixed initialization of reset and interrupt pins * Update components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c Co-authored-by: Vilem Zavodny <98878239+espzav@users.noreply.github.com> * Update components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c Co-authored-by: Vilem Zavodny <98878239+espzav@users.noreply.github.com> * correct names of config gpio variables --------- Co-authored-by: ivancorrea Co-authored-by: Vilem Zavodny <98878239+espzav@users.noreply.github.com> --- .../esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c b/components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c index 22a7fd82..33674e67 100644 --- a/components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c +++ b/components/lcd_touch/esp_lcd_touch_ft5x06/esp_lcd_touch_ft5x06.c @@ -122,26 +122,26 @@ esp_err_t esp_lcd_touch_new_i2c_ft5x06(const esp_lcd_panel_io_handle_t io, const if (esp_lcd_touch_ft5x06->config.int_gpio_num != GPIO_NUM_NC) { const gpio_config_t int_gpio_config = { .mode = GPIO_MODE_INPUT, + .intr_type = GPIO_INTR_NEGEDGE, .pin_bit_mask = BIT64(esp_lcd_touch_ft5x06->config.int_gpio_num) }; ret = gpio_config(&int_gpio_config); ESP_GOTO_ON_ERROR(ret, err, TAG, "GPIO config failed"); + + /* Register interrupt callback */ + if (esp_lcd_touch_ft5x06->config.interrupt_callback) { + esp_lcd_touch_register_interrupt_callback(esp_lcd_touch_ft5x06, esp_lcd_touch_ft5x06->config.interrupt_callback); + } } /* Prepare pin for touch controller reset */ if (esp_lcd_touch_ft5x06->config.rst_gpio_num != GPIO_NUM_NC) { const gpio_config_t rst_gpio_config = { .mode = GPIO_MODE_OUTPUT, - .intr_type = GPIO_INTR_NEGEDGE, .pin_bit_mask = BIT64(esp_lcd_touch_ft5x06->config.rst_gpio_num) }; ret = gpio_config(&rst_gpio_config); ESP_GOTO_ON_ERROR(ret, err, TAG, "GPIO config failed"); - - /* Register interrupt callback */ - if (esp_lcd_touch_ft5x06->config.interrupt_callback) { - esp_lcd_touch_register_interrupt_callback(esp_lcd_touch_ft5x06, esp_lcd_touch_ft5x06->config.interrupt_callback); - } } /* Init controller */