-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Esp32 s3 touch fix #3798
Esp32 s3 touch fix #3798
Conversation
touch is implemented differently on S2 and S3, these changes make touch buttons work on S2 and S3
now better fits the default threshold value of 32
Thanks. Can you also update EDIT: From lines 239 onward. |
I see no change necessary, the digitalPinToTouchChannel() works as is for S2 and S3 (according to comment above the function): " this function works for ESP32, ESP32-S2 and ESP32-S3 - including the C3, it will return -1 for any pin" |
But where does then ISR get attached when user sets up a new button? He/she would need to bounce WLED. I do not want that. |
ISR does not actively need to be attached, its a native interrupt vector. pinmode() should take care of that. it works on my S3 so it seems interrupt is set correctly. |
-added minimum threshold, had some crashes when setting threshold to zero before -moved interrupt detach to GPIO deallocation where it belongs -added check for touchbutton before detaching interrupt -moved thochThreshold readout up so it gets updated before passing it to the system call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deataching interrupt handlers in PinManager is only an option if PinManager was also responsible for attaching such handlers.
IMO you can work to incorporate attaching handler into PinManager or remove detaching from PinManager and detach handler in set.cpp
in the same place where attaching happens (I would prefer this second option).
Indentation fix
Indentation fix
Compile fix
fixes touch for S2 and S3 boards. As touch does not work at all without this fix, even though not thoroughly tested, it cannot make things any worse I think.