mirror of
https://github.com/FunKey-Project/FunKey-GPIO-Mapping.git
synced 2025-12-15 19:28:54 +01:00
added access i2c by I2C_SLAVE_FORCE in case access by I2C_SLAVE not authorized (copied from busybox drivers)
This commit is contained in:
parent
7df1c06849
commit
8a756e9008
@ -49,8 +49,12 @@ bool axp209_init(void) {
|
|||||||
if (ioctl(fd_axp209, I2C_SLAVE, AXP209_I2C_ADDR) < 0) {
|
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");
|
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
|
// ERROR HANDLING; you can check errno to see what went wrong
|
||||||
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Enable only chosen interrupts (PEK short and long presses)
|
// Enable only chosen interrupts (PEK short and long presses)
|
||||||
int err;
|
int err;
|
||||||
|
|||||||
@ -47,8 +47,13 @@ bool pcal6416a_init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(fd_i2c_expander,I2C_SLAVE,PCAL6416A_I2C_ADDR) < 0) {
|
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
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user