Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LVGL touch #541

Closed
wants to merge 1 commit into from
Closed

Fix LVGL touch #541

wants to merge 1 commit into from

Conversation

Riksu9000
Copy link
Contributor

@Riksu9000 Riksu9000 commented Jul 31, 2021

LVGL reads the touch position twice for some reason. The first time it is read, tapped is true and set to false. The second time it is read, tapped value is false, so LVGL thinks all touches are rapid taps.

The touch is read in lv_task_handler(), so by setting the value to false manually after it fixes the issue.

LVGL reads the touch point every 20ms so if lv_task_handler() is run early, the touch isn't read but it's still cleared. This is why the touchProcessed variable is needed.

This will fix #491 while #492 isn't ready.

@Riksu9000 Riksu9000 marked this pull request as draft July 31, 2021 10:37
@Riksu9000 Riksu9000 marked this pull request as ready for review July 31, 2021 12:39
@kalaspuffar
Copy link

Using booleans for these events? Is it because of multi thread. I remember creating a search box with suggestions and adding a delayed reading of 300 ms before triggering the search in order to be sure of intent. Perhaps the reading of a touch event needs a value for how long a press should be in order to register intent?

Just a thought.

@Riksu9000
Copy link
Contributor Author

Using booleans for these events? Is it because of multi thread. I remember creating a search box with suggestions and adding a delayed reading of 300 ms before triggering the search in order to be sure of intent. Perhaps the reading of a touch event needs a value for how long a press should be in order to register intent?

Just a thought.

LVGL has it's own way of detecting click events. All LVGL needs is the "cursor" position and whether it is clicked (or touching in the case of a touchscreen) and LVGL handles the rest. The current way this is implemented in InfiniTime isn't quite as intended, and this PR fixes an issue with the current implementation. I've been working on a better implementation at #492, but it still has some issues so this PR is just to fix a bug in the mean time.

@hatmajster
Copy link
Contributor

I've been testing this yesterday and yes, it fixes the metronome laggines. Now its almost perfectly snappy.
Doesn't seem to fix anything else, the draw app seems to work exactly the same, pong too (i thought that it would be more responsive here, probably there are other bottlenecks). Works nicely

@JF002
Copy link
Collaborator

JF002 commented Aug 10, 2021

This will fix #491 while #492 isn't ready.

Does this mean that I shouldn't merge this branch if I plan on merging #492?

@Riksu9000
Copy link
Contributor Author

Riksu9000 commented Aug 10, 2021

This will fix #491 while #492 isn't ready.

Does this mean that I shouldn't merge this branch if I plan on merging #492?

Depends on how soon #492 will be ready, which might be very soon now. Not so sure anymore

@Riksu9000
Copy link
Contributor Author

No longer needed.

@Riksu9000 Riksu9000 closed this Aug 28, 2021
@Riksu9000 Riksu9000 deleted the fix_lvgl_touch branch January 21, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metronome arc is laggy
4 participants