Merge pull request #14635 from s-hadinger/lvgl_log_was_touched

LVGL log TS when released
This commit is contained in:
s-hadinger 2022-01-28 09:06:16 +01:00 committed by GitHub
commit 2f0036136d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,6 +130,7 @@ int16_t XPT2046_y() {
void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
static bool was_touched = false; // flag used to log the data sent when the screen was just released
#ifdef USE_FT5206
if (FT5206_found) {
@ -154,6 +155,7 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
raw_touch_xp = touch_xp;
raw_touch_yp = touch_yp;
if (touched) {
was_touched = true;
#ifdef USE_TOUCH_BUTTONS
#ifdef USE_M5STACK_CORE2
// handle 3 built in touch buttons
@ -183,6 +185,10 @@ void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
#endif // USE_TOUCH_BUTTONS
} else {
if (was_touched) {
AddLog(LOG_LEVEL_DEBUG_MORE, "TS : released x=%i y=%i (raw x=%i y=%i)", touch_xp, touch_yp, raw_touch_xp, raw_touch_yp);
was_touched = false;
}
#ifdef USE_M5STACK_CORE2
for (uint32_t tbut = 0; tbut < 3; tbut++) {
if (tbstate[tbut] & 1) {