Please review these changes for inclusion #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Small change of 20 lines uses interrupt pin to gate the actual touch reading.
I tried to fit it into the PJRC code model - there is one exposed value that would allow user code to disable touch reading (until next interrupt if enabled)
Putting the CPP class code as an ISR was done based on FrankB's personal usage.
On interrupt only a BOOLEAN flag is set.
Doing anything more complex enters the realm of race condition cascading interrupts.
The boolean goes false AFTER the prior SPI read is detects NO_TOUCH, which will have triggered the interrupt in the process. DIsabling it then will set it false, preventing added SPI reads of touch until the interrupt falls again.
I have tested this to work with T_3.1 and T_LC. LC works on TouchTest, I also tested on a complex graphics button example with LC and AdaFruit driver.