-
Couldn't load subscription status.
- Fork 606
Closed
Labels
Description
Describe the bug
In the Mcp23xxx driver (used by Mcp23008, Mcp23017, etc) the interrupt handler has a loop where it checks if the mask is matching the pending interrupts, but the loop checks only 4 of the total 8 pins, so interrupts are never working on pins 5-8 (for either port A and B on Mcp23017). This is the code:
int mask = 1;
int pin = 0;
while (mask < 0x10)
{
if ((interruptPending & mask) != 0)
{
CallHandlerOnPin(pin + offset, newValues & mask);
}
mask = mask << 1;
pin++;
}
Steps to reproduce
Hook up a button to pin 5-8 and you'll never receive the interrupts.
Expected behavior
Interrupts should received
Actual behavior
Nothing
Versions used
4.0.1