|
|
|
|
@ -248,12 +248,15 @@ int test_i2c_bus(int bus)
|
|
|
|
|
{
|
|
|
|
|
int output = 1;
|
|
|
|
|
char *busString = "/dev/i2c-3";
|
|
|
|
|
char *busS[5];
|
|
|
|
|
|
|
|
|
|
if (access(busString, W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present
|
|
|
|
|
// printf("bus is present\n\n");
|
|
|
|
|
char result[128];
|
|
|
|
|
char command[50] = "timeout 10 i2cdetect -y ";
|
|
|
|
|
strcat (command, itoa(bus));
|
|
|
|
|
sprintf(busS, "%d", bus);
|
|
|
|
|
printf("Bus String: %s \n", busS);
|
|
|
|
|
strcat (command, busS);
|
|
|
|
|
// printf("Command: %s \n", command);
|
|
|
|
|
FILE *i2cdetect = popen(command, "r");
|
|
|
|
|
|
|
|
|
|
|