diff --git a/driver_axp209.c b/driver_axp209.c index 5d1dd37..2408172 100755 --- a/driver_axp209.c +++ b/driver_axp209.c @@ -49,7 +49,11 @@ bool axp209_init(void) { if (ioctl(fd_axp209, I2C_SLAVE, AXP209_I2C_ADDR) < 0) { printf("In axp209_init - Failed to acquire bus access and/or talk to slave.\n"); // ERROR HANDLING; you can check errno to see what went wrong - return false; + if (ioctl(fd_axp209, I2C_SLAVE_FORCE, AXP209_I2C_ADDR) < 0) { + printf("In axp209_init - Failed to acquire FORCED bus access and/or talk to slave.\n"); + // ERROR HANDLING; you can check errno to see what went wrong + return false; + } } // Enable only chosen interrupts (PEK short and long presses) diff --git a/driver_pcal6416a.c b/driver_pcal6416a.c index 510a44b..d1c95f9 100755 --- a/driver_pcal6416a.c +++ b/driver_pcal6416a.c @@ -47,8 +47,13 @@ bool pcal6416a_init(void) { } if (ioctl(fd_i2c_expander,I2C_SLAVE,PCAL6416A_I2C_ADDR) < 0) { - printf("Failed to acquire bus access and/or talk to slave.\n"); + printf("In pcal6416a_init - Failed to acquire bus access and/or talk to slave.\n"); // ERROR HANDLING; you can check errno to see what went wrong + if (ioctl(fd_i2c_expander, I2C_SLAVE_FORCE, PCAL6416A_I2C_ADDR) < 0) { + printf("In pcal6416a_init - Failed to acquire FORCED bus access and/or talk to slave.\n"); + // ERROR HANDLING; you can check errno to see what went wrong + return false; + } return false; }