|
|
|
@ -258,7 +258,9 @@ int test_i2c_bus(int bus)
|
|
|
|
if (access(busString, W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present
|
|
|
|
if (access(busString, W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present
|
|
|
|
// printf("bus is present\n\n");
|
|
|
|
// printf("bus is present\n\n");
|
|
|
|
char result[128];
|
|
|
|
char result[128];
|
|
|
|
char command[50] = "timeout 10 i2cdetect -y ";
|
|
|
|
char command_start = "timeout 10 i2cdetect -y ";
|
|
|
|
|
|
|
|
char command[50];
|
|
|
|
|
|
|
|
strcpy (command, command_start);
|
|
|
|
strcat (command, busS);
|
|
|
|
strcat (command, busS);
|
|
|
|
// printf("Command: %s \n", command);
|
|
|
|
// printf("Command: %s \n", command);
|
|
|
|
FILE *i2cdetect = popen(command, "r");
|
|
|
|
FILE *i2cdetect = popen(command, "r");
|
|
|
|
|