Skip to content

Commit 8f1370d

Browse files
authored
Merge pull request #84 from ropg/fix_ft6x36
FT6X36 touch: fixed axis-swap, Kconfig defaults.
2 parents 557679a + f32a6f5 commit 8f1370d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lvgl_touch/Kconfig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,20 @@ menu "LVGL Touch controller"
239239
menu "Touchpanel Configuration (FT6X06)"
240240
depends on LV_TOUCH_CONTROLLER_FT6X06
241241

242-
config LV_FT6X36_SWAPXY
243-
bool
244-
prompt "Swap X with Y coordinate."
245-
default y
242+
config LV_FT6X36_SWAPXY
243+
bool
244+
prompt "Swap X with Y coordinate."
245+
default n
246246

247247
config LV_FT6X36_INVERT_X
248248
bool
249249
prompt "Invert X coordinate value."
250250
default n
251251

252-
config LV_FT6X36_INVERT_Y
253-
bool
254-
prompt "Invert Y coordinate value."
255-
default y
252+
config LV_FT6X36_INVERT_Y
253+
bool
254+
prompt "Invert Y coordinate value."
255+
default n
256256

257257
endmenu
258258

lvgl_touch/ft6x36.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,20 @@ bool ft6x36_read(lv_indev_drv_t *drv, lv_indev_data_t *data) {
182182
last_x = ((data_xy[0] & FT6X36_MSB_MASK) << 8) | (data_xy[1] & FT6X36_LSB_MASK);
183183
last_y = ((data_xy[2] & FT6X36_MSB_MASK) << 8) | (data_xy[3] & FT6X36_LSB_MASK);
184184

185-
#if CONFIG_LV_FT6X36_SWAPXY
186-
int16_t swap_buf = last_x;
187-
last_x = last_y;
188-
last_y = swap_buf;
189-
#endif
190185
#if CONFIG_LV_FT6X36_INVERT_X
191186
last_x = LV_HOR_RES - last_x;
192187
#endif
193188
#if CONFIG_LV_FT6X36_INVERT_Y
194189
last_y = LV_VER_RES - last_y;
190+
#endif
191+
#if CONFIG_LV_FT6X36_SWAPXY
192+
int16_t swap_buf = last_x;
193+
last_x = last_y;
194+
last_y = swap_buf;
195195
#endif
196196
data->point.x = last_x;
197197
data->point.y = last_y;
198198
data->state = LV_INDEV_STATE_PR;
199-
ESP_LOGV(TAG, "X=%u Y=%u", data->point.x, data->point.y);
199+
ESP_LOGD(TAG, "X=%u Y=%u", data->point.x, data->point.y);
200200
return false;
201201
}

0 commit comments

Comments
 (0)