Thanks - both for the welcone and the response.
However, I'm afraid I didn't make myself clear in my question - let me try again.
I am using an Arduino Pro Micro, which is based on a 32u4, since it handles USB natively, so I can set it up (with the Joystick library) as HID device without additional hardware. The 32u4 has 5 native interrupt pins that each has a dedicated interrupt vector. However, of these 5
- 2 are blocked for RXD and TXD
- 2 are blocked for SCL and SDA
- and the remaining one I've allocated for a rotary encoder (which works fine btw, also using your library - even if switching the accelerationMode was a bit of a hassle
)
The 32u4 also has 8 pins capable of PCINT (pin change interrupt) which share one common interrupt vector (PCINT0), four of which I've wired to the interrupt lines from the 8574's. My question is now: would the interrupt version of the switches initialisation also work from the PCINT pins - and if yes, would this also be true for multiple PCINTs (which all will trigger the same interrupt vector)? Simply trying it dry (just compile, don't run - I don't have the time right now, maybe later) is inconclusive, as even
switches.initialiseInterrupt(ioFrom8574(0x20, 99), true);
doesn't trigger a compile error
(just out of interest: which interrupt vector would that use - from checking the code, I'd guess it'll end up at 0xff)
Reading a bit deeper into interrupts on Arduino (and your source code), the answer is probably "No", as the Arduino IDE itself won't handle the PCINT pins. So it looks like I'll have to drop the IoAbstraction for my project (at least the switch handling) and use TaskManager directly.