LVGL log TS when released

This commit is contained in:
Stephan Hadinger 2022-01-28 08:56:00 +01:00
parent 295cfca805
commit d922aa7beb

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) {