Skip to content

Commit f687a9f

Browse files
committed
feat(multi-touch): Apply feedback from review
1 parent 0819a8e commit f687a9f

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

components/esp_lvgl_port/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.7.0
4+
5+
### Features
6+
7+
- Added support for multi-touch gestures.
8+
39
## 2.6.3
410

511
### Fixes

components/esp_lvgl_port/Kconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,4 @@ menu "ESP LVGL PORT"
66
default n
77
help
88
Enables using PPA for screen rotation.
9-
config LVGL_PORT_ENABLE_GESTURES
10-
depends on LV_USE_GESTURE_RECOGNITION
11-
bool "Enable gesture detection"
12-
default n
13-
help
14-
Enables gesture detection.
159
endmenu

components/esp_lvgl_port/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Display rotation can be changed at runtime.
277277
278278
### Detecting gestures
279279

280-
LVGL includes support for software detection of multi-touch gestures.
280+
LVGL (version 9.4 and higher) includes support for software detection of multi-touch gestures.
281281
This detection can be enabled by setting the `LVGL_PORT_ENABLE_GESTURES` config and having `ESP_LCD_TOUCH_MAX_POINTS` > 1.
282282
Example usage of the gesture callback can be found in LVGL [documentation](https://docs.lvgl.io/master/details/main-modules/indev/gestures.html).
283283

components/esp_lvgl_port/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.6.4"
1+
version: "2.7.0"
22
description: ESP LVGL port
33
url: https://github.com/espressif/esp-bsp/tree/master/components/esp_lvgl_port
44
dependencies:

components/esp_lvgl_port/src/lvgl9/esp_lvgl_port_touch.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "esp_lcd_touch.h"
1111
#include "esp_lvgl_port.h"
1212
#include "esp_timer.h"
13+
#include "sdkconfig.h"
1314

1415
static const char *TAG = "LVGL";
1516

@@ -128,19 +129,19 @@ static void lvgl_port_touchpad_read(lv_indev_t *indev_drv, lv_indev_data_t *data
128129
/* Read data from touch controller */
129130
bool touchpad_pressed = esp_lcd_touch_get_coordinates(touch_ctx->handle, touchpad_x, touchpad_y, NULL, &touchpad_cnt, CONFIG_ESP_LCD_TOUCH_MAX_POINTS);
130131

131-
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LVGL_PORT_ENABLE_GESTURES)
132+
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LV_USE_GESTURE_RECOGNITION)
132133
// Number of touch points which need to be constantly updated inside gesture recognizers
133134
#define GESTURE_TOUCH_POINTS 2
134135

135136
uint8_t touchpad_track_id[CONFIG_ESP_LCD_TOUCH_MAX_POINTS] = {0};
136137

137-
/* Read track IDs for TODO number of touch points*/
138+
/* Read track IDs for first two touch points*/
138139
esp_err_t err = esp_lcd_touch_get_track_id(touch_ctx->handle, touchpad_track_id, GESTURE_TOUCH_POINTS);
139140

140141
/* Initialize LVGL touch data for each activated touch point */
141142
/* static */ lv_indev_touch_data_t touches[CONFIG_ESP_LCD_TOUCH_MAX_POINTS] = {0};
142143
if (err != ESP_ERR_NOT_SUPPORTED) {
143-
for (int i = 0; i < touchpad_cnt; i++) {
144+
for (int i = 0; i < touchpad_cnt && i < CONFIG_ESP_LCD_TOUCH_MAX_POINTS; i++) {
144145
touches[i].state = LV_INDEV_STATE_PRESSED;
145146
touches[i].point.x = touchpad_x[i];
146147
touches[i].point.y = touchpad_y[i];

components/lcd_touch/esp_lcd_touch/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.1.3"
1+
version: "1.2.0"
22
description: ESP LCD Touch - main component for using touch screen controllers
33
url: https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch/esp_lcd_touch
44
dependencies:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
version: "1.1.4"
1+
version: "1.2.0"
22
description: ESP LCD Touch GT911 - touch controller GT911
33
url: https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch/esp_lcd_touch_gt911
44
dependencies:
55
idf: ">=4.4.2"
66
esp_lcd_touch:
7-
version: "^1.1.0"
7+
version: "^1.2.0"
88
public: true
99
override_path: ../esp_lcd_touch

examples/display/main/lvgl_demo_ui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static lv_color_t arc_color[] = {
2929
LV_COLOR_MAKE(90, 202, 228),
3030
};
3131

32-
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LVGL_PORT_ENABLE_GESTURES)
32+
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LV_USE_GESTURE_RECOGNITION)
3333
void gesture_cb(lv_event_t *e)
3434
{
3535
static uint32_t logo_scale = LV_SCALE_NONE;
@@ -157,7 +157,7 @@ void example_lvgl_demo_ui(lv_obj_t *scr)
157157
lv_img_set_src(img_logo, &esp_logo);
158158
lv_obj_center(img_logo);
159159

160-
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LVGL_PORT_ENABLE_GESTURES)
160+
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LV_USE_GESTURE_RECOGNITION)
161161
lv_obj_add_event_cb(scr, gesture_cb, LV_EVENT_GESTURE, NULL);
162162
#endif
163163

examples/display/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void app_main(void)
2525
ESP_LOGI("example", "Display LVGL animation");
2626
bsp_display_lock(0);
2727
lv_obj_t *scr = lv_disp_get_scr_act(NULL);
28-
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LVGL_PORT_ENABLE_GESTURES)
28+
#if (CONFIG_ESP_LCD_TOUCH_MAX_POINTS > 1 && CONFIG_LV_USE_GESTURE_RECOGNITION)
2929
lv_indev_t *indev = bsp_display_get_input_dev();
3030
lv_indev_set_rotation_rad_threshold(indev, 0.15f);
3131
#endif

examples/display/sdkconfig.bsp.esp-box-3

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ CONFIG_LV_USE_PERF_MONITOR=y
2828

2929
CONFIG_LV_USE_FLOAT=y
3030
CONFIG_LV_USE_GESTURE_RECOGNITION=y
31-
CONFIG_LVGL_PORT_ENABLE_GESTURES=y

0 commit comments

Comments
 (0)