|
|
|
|
@ -246,7 +246,7 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
int test_i2c_bus(int bus)
|
|
|
|
|
{
|
|
|
|
|
int result = 1;
|
|
|
|
|
int output = 1;
|
|
|
|
|
char *busString = "/dev/i2c-3";
|
|
|
|
|
|
|
|
|
|
if (access(busString, W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present
|
|
|
|
|
@ -266,12 +266,12 @@ int test_i2c_bus(int bus)
|
|
|
|
|
if (error != 0)
|
|
|
|
|
{
|
|
|
|
|
printf("ERROR: %d bus has a problem \n Check I2C wiring and pullup resistors \n", bus);
|
|
|
|
|
result = -1;
|
|
|
|
|
output = -1;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
printf("ERROR: %d bus has a problem \n Check software to see if enabled \n", bus);
|
|
|
|
|
result = -1;
|
|
|
|
|
output = -1;
|
|
|
|
|
}
|
|
|
|
|
return(result);
|
|
|
|
|
return(output);
|
|
|
|
|
}
|
|
|
|
|
|