Skip to content

Conversation

iabdalkader
Copy link
Contributor

@iabdalkader iabdalkader commented Aug 28, 2025

Additionally, fixes race conditions in event update/reading.

@per1234 per1234 added bug Something isn't working enhancement New feature or request labels Aug 29, 2025
@iabdalkader iabdalkader force-pushed the zephyr_on_detect branch 4 times, most recently from 4170005 to 270cde5 Compare September 3, 2025 15:25
@pennam pennam self-requested a review September 8, 2025 08:32
Copy link
Contributor

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iabdalkader testing this on my giga i'm getting weird values regarding the number of touch points. Even if I touch the display in one single point, the sketch reports 5 contacs. I've fixed this adding memset(_points, 0, sizeof(_points)); in the begin function.

@pennam
Copy link
Contributor

pennam commented Sep 8, 2025

I've fixed this adding memset(_points, 0, sizeof(_points)); in the begin function.

this is not true... I'm still having the issue.

@iabdalkader
Copy link
Contributor Author

The instance should be in BSS so it should be zero'd. Is this polling or IRQ mode? In IRQ mode you get all points, with pressed set to 1 for touch. It's this way so we don't have to allocate a temporary stack buffer in the callback handler.

@pennam
Copy link
Contributor

pennam commented Sep 8, 2025

I was testing IRQ mode. Yes now i get it, the number of points is fixed here. Using the same sketch with mbed you get the real number of contacts not the maximum value.

@iabdalkader
Copy link
Contributor Author

Using the same sketch with mbed you get the real number of contacts not the maximum value.

I know. We can make it work the same way, but since the mbed port is probably going to be deprecated anyway, I wonder if there's any point in keeping the API compatible. Note the API has other problems, for example no release detection, user could pass a smaller array to getTouchPoints, etc.. Anyway, let me know how you want to fix it.

@iabdalkader iabdalkader force-pushed the zephyr_on_detect branch 2 times, most recently from 4678f4d to 9cb0bb4 Compare September 9, 2025 07:02
@iabdalkader
Copy link
Contributor Author

@pennam I fixed it using another copy of points in the class.

@iabdalkader iabdalkader requested a review from pennam September 9, 2025 07:02
@pennam pennam merged commit 7098b03 into arduino-libraries:main Sep 18, 2025
3 checks passed
@iabdalkader iabdalkader deleted the zephyr_on_detect branch September 18, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants