diff --git a/components/lcd_touch/esp_lcd_touch_cst816s/esp_lcd_touch_cst816s.c b/components/lcd_touch/esp_lcd_touch_cst816s/esp_lcd_touch_cst816s.c index 945c0b9c8..464b01662 100644 --- a/components/lcd_touch/esp_lcd_touch_cst816s/esp_lcd_touch_cst816s.c +++ b/components/lcd_touch/esp_lcd_touch_cst816s/esp_lcd_touch_cst816s.c @@ -60,23 +60,23 @@ esp_err_t esp_lcd_touch_new_i2c_cst816s(const esp_lcd_panel_io_handle_t io, cons if (cst816s->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(cst816s->config.int_gpio_num) }; ESP_GOTO_ON_ERROR(gpio_config(&int_gpio_config), err, TAG, "GPIO intr config failed"); + + /* Register interrupt callback */ + if (cst816s->config.interrupt_callback) { + esp_lcd_touch_register_interrupt_callback(cst816s, cst816s->config.interrupt_callback); + } } /* Prepare pin for touch controller reset */ if (cst816s->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(cst816s->config.rst_gpio_num) }; ESP_GOTO_ON_ERROR(gpio_config(&rst_gpio_config), err, TAG, "GPIO reset config failed"); - - /* Register interrupt callback */ - if (cst816s->config.interrupt_callback) { - esp_lcd_touch_register_interrupt_callback(cst816s, cst816s->config.interrupt_callback); - } } /* Reset controller */ ESP_GOTO_ON_ERROR(reset(cst816s), err, TAG, "Reset failed"); @@ -160,9 +160,9 @@ static esp_err_t reset(esp_lcd_touch_handle_t tp) { if (tp->config.rst_gpio_num != GPIO_NUM_NC) { ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, tp->config.levels.reset), TAG, "GPIO set level failed"); - vTaskDelay(pdMS_TO_TICKS(10)); + vTaskDelay(pdMS_TO_TICKS(200)); ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, !tp->config.levels.reset), TAG, "GPIO set level failed"); - vTaskDelay(pdMS_TO_TICKS(10)); + vTaskDelay(pdMS_TO_TICKS(200)); } return ESP_OK; diff --git a/components/lcd_touch/esp_lcd_touch_cst816s/idf_component.yml b/components/lcd_touch/esp_lcd_touch_cst816s/idf_component.yml index 06cd53046..d16156fe0 100644 --- a/components/lcd_touch/esp_lcd_touch_cst816s/idf_component.yml +++ b/components/lcd_touch/esp_lcd_touch_cst816s/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.2~1" +version: "1.0.3" description: ESP LCD Touch CST816S - touch controller CST816S url: https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch/esp_lcd_touch_cst816s dependencies: