-
Notifications
You must be signed in to change notification settings - Fork 313
XPT2046 optionally (Kconfig option) validate a touch with pressure, not just IRQ low #9
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
Conversation
|
I've added an additional config option to use pressure only and ignore IRQ (not even configure the pin). |
|
Hi @liebman, all looks good. Do you think is it possible to move the touch detection code into a new function that returns 0 when there's no touch detected and another positive number when there's touch detected? Something like |
|
@C47D is there a specific use case for this? (your asking for this to be non-static I assume) EDIT: or maybe this is just to make the logic more readable.... Can it return a |
Yes, to make the logic more readable, and yes, it can return a bool or an enum, I find enums be more readables. typedef enum {
TOUCH_NOT_DETECTED = 0,
TOUCH_DETECTED = 1,
} xpt2046_touch_detected; |
|
@C47D I'm looking for a better name for the |
|
Maybe |
|
@C47D I've refactored it a bit. One more change that may help is to make the
Thoughts? |
|
Tried the |
|
Hi, it looks good, I don't have any hardware to test it, is it ready to merge? |
|
Yes :-) |
|
Thanks for the work you've put into this. I will try to test this with hardware once I get some free time. |
Sometimes IRQ is very noisy an prevents things like idle time detection. This PR will check to insure there is pressure detected on the panel, not just the noisy IRQ signal. Disabled by default in Kconfig.
Fixes #7