Skip to content

touchAttachInterrupt() userfunc parameter should not be void #4321

Closed
@ericgu

Description

@ericgu

I'm working on some code that uses the touch subsystem and the arduino HAL.

I can call touchAttachInterrupt() multiple times for different pins. The underlying code in __touchISR() knows which routine to call for a specific pin, but it doesn't pass any pin information on.

This forces me to write something like:
touchAttachInterrupt(4, Touch0Interrupt, 20);
...
touchAttachment(32, Touch9Interrupt, 20);

touchAttachInterrupt() should store the pin number away at the same time it stores the function pointer away and then pass it on the callback. That would let me write a routine like:

void MyTouchHandler(int pinNumber)
{

}

and handle all the touch pins with a single chunk of generic code.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions