Change search path for i2c devices on linux

Looking for devices by bus instead of class should fix issues where the
class is named differently, e.g. i2c-dev instead of i2c-adapter.
This commit is contained in:
Steven Franzen
2019-10-26 17:34:39 +02:00
committed by Adam Honse
parent 6612e8990f
commit 252ecf424e

View File

@@ -265,8 +265,8 @@ void DetectI2CBusses()
struct dirent * ent;
int test_fd;
// Start looking for I2C adapters in /sys/class/i2c-adapter/
strcpy(driver_path, "/sys/class/i2c-adapter/");
// Start looking for I2C adapters in /sys/bus/i2c/devices/
strcpy(driver_path, "/sys/bus/i2c/devices/");
dir = opendir(driver_path);
if(dir == NULL)