From 55608548fc1badce771f9f1e4e1b69c52e914e9c Mon Sep 17 00:00:00 2001 From: Guy McSwain Date: Fri, 18 Dec 2020 19:56:35 -0600 Subject: [PATCH] Fix Issue#402 Cannot handle multiple I2C devices on RPi 4B --- pigpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pigpio.c b/pigpio.c index 92b9bf7..9428b71 100644 --- a/pigpio.c +++ b/pigpio.c @@ -4116,7 +4116,7 @@ int i2cOpen(unsigned i2cBus, unsigned i2cAddr, unsigned i2cFlags) i2cInfo[slot].addr = i2cAddr; i2cInfo[slot].flags = i2cFlags; i2cInfo[slot].funcs = funcs; - i2cInfo[i].state = PI_I2C_OPENED; + i2cInfo[slot].state = PI_I2C_OPENED; return slot; }