feat(touch): Support all touch versions in NG driver#11643
feat(touch): Support all touch versions in NG driver#11643
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results144 files 144 suites 40m 54s ⏱️ Results for commit 6b91048. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@me-no-dev @SuGlider @lucasssvaz PR is ready to me reviewed. HW CI test is failing but it works locally. |
|
All good now. Also CI tests are passing. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a unified touch sensor driver that supports all ESP32 variants (ESP32, ESP32-S2, ESP32-S3, ESP32-P4) by replacing the legacy touch implementation with the modern NG driver. The change improves reliability and maintainability while introducing a breaking change for ESP32's touchInterruptSetThresholdDirection() function.
- Unified NG driver implementation supporting all ESP32 variants with version-specific configurations
- Updated examples and tests to use the new touch API and simplified threshold handling
- Breaking change: ESP32
touchInterruptSetThresholdDirection()must be called before pin setup
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/validation/touch/touch.ino | Updated test to use unified threshold logic and reduced test channels |
| tests/validation/touch/ci.json | Added verbose debug logging for tests |
| libraries/ESP32/examples/Touch/TouchRead/TouchRead.ino | Changed from T1 to T2 pin for consistency |
| libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino | Simplified threshold handling with benchmark-based approach |
| libraries/ESP32/examples/Touch/TouchButtonV2/* | Removed V2-specific example (now unified) |
| libraries/ESP32/examples/Touch/TouchButton/* | Updated to use unified touch API with status checking |
| cores/esp32/esp32-hal-touch.h | Added IDF version check for legacy driver |
| cores/esp32/esp32-hal-touch.c | Added IDF version check for legacy driver |
| cores/esp32/esp32-hal-touch-ng.h | Extended NG driver to support all ESP32 variants |
| cores/esp32/esp32-hal-touch-ng.c | Implemented unified NG driver with chip-specific configurations |
| CMakeLists.txt | Added touch sensor driver requirement for all supported chips |
| .github/scripts/tests_run.sh | Added verbose output flag for pytest |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description of Change
This PR introduces a unified touch sensor driver that supports all ESP32 variants (ESP32, ESP32-S2, ESP32-S3, ESP32-P4) with improved reliability and maintainability. The legacy touch implementation has been replaced with the modern NG driver, and all related examples and tests have been updated accordingly.
BREAKING CHANGE:
For ESP32
touchInterruptSetThresholdDirection(bool mustbeLower)can now be used only before setting up the touch pin.Tests scenarios
Tested using ESP32, ESP32-S2, ESP32-S3 and P4.
Related links
Closes #11637