Skip to content

Commit 43e6e69

Browse files
Merge pull request #112 from Y1hsiaochunnn/master
Fix the problem of poor touch interruption in cst9217
2 parents 890af8c + f6821d2 commit 43e6e69

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

display/touch/esp_lcd_touch_cst9217/esp_lcd_touch_cst9217.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ esp_err_t esp_lcd_touch_new_i2c_cst9217(const esp_lcd_panel_io_handle_t io, cons
7272
/* Save config */
7373
memcpy(&cst9217->config, config, sizeof(esp_lcd_touch_config_t));
7474

75+
if (cst9217->config.int_gpio_num != GPIO_NUM_NC) {
76+
const gpio_config_t int_gpio_config = {
77+
.mode = GPIO_MODE_INPUT,
78+
.intr_type = (cst9217->config.levels.interrupt ? GPIO_INTR_POSEDGE : GPIO_INTR_NEGEDGE),
79+
.pin_bit_mask = BIT64(cst9217->config.int_gpio_num)
80+
};
81+
ESP_GOTO_ON_ERROR(gpio_config(&int_gpio_config), err, TAG, "GPIO intr config failed");
82+
83+
/* Register interrupt callback */
84+
if (cst9217->config.interrupt_callback) {
85+
esp_lcd_touch_register_interrupt_callback(cst9217, cst9217->config.interrupt_callback);
86+
}
87+
}
88+
7589
/* Initialize reset GPIO */
7690
if (cst9217->config.rst_gpio_num != GPIO_NUM_NC)
7791
{

display/touch/esp_lcd_touch_cst9217/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ dependencies:
55
idf: '>=4.4.2'
66
description: "ESP LCD Touch CST9217 -The touch controller CST9217 is adapted by waveshare"
77
url: "https://github.com/waveshareteam/Waveshare-ESP32-components/tree/master/display/touch/esp_lcd_touch_cst9217"
8-
version: "1.0.3"
8+
version: "1.0.4"

0 commit comments

Comments
 (0)