Skip to content

Commit

Permalink
Extend the reset time and fix the interruption
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzw655 committed Jun 14, 2023
1 parent 22aa831 commit c71db32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit c71db32

Please sign in to comment.