Is possible to 'know' which pin caused the interrupt inside interrupt function?
My idea is to create 'configurable' pins inside my program. User can select N pins to act as IR sensor. Each of these sensors is connected to an interrupt routine which receive data and work as needed. But now, I have an static function declaration for each pin and I would like to make only one function and 'detect' the exactly pin inside function.
This is something that I have now:
's0_handler' is a static function....and I have to write one for each pin right now. I would liek to make only one function for all pins and detect which pin inside. Is it possible?
Code: Select all
// Sensor 1 pinMode(sensors.pin, INPUT); pullUpDnControl(sensors.pin, PUD_UP); wiringPiISR(sensors.pin, INT_EDGE_BOTH, s0_handler);