commented out debug printfs

pull/51/head
alanbjohnston 6 years ago committed by GitHub
parent e77391f8b2
commit 06ff8256ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -127,15 +127,15 @@ struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
struct SensorConfig data;
if (access(bus, W_OK | R_OK) < 0) { // Test if I2C Bus is missing
printf("ERROR: %s bus not present \n Is it enabled in /boot/config.txt? \n", bus);
printf("ERROR: %s bus not present \n Check raspi-config Interfacing Options/I2C/Enable and /boot/config.txt \n", bus);
data.fd = OFF;
return (data);
}
char result[128];
int pos = strlen(bus) / sizeof(bus[0]) - 1;
printf("Bus size %d \n", pos);
printf("Bus value %d \n", atoi(&bus[pos]));
// printf("Bus size %d \n", pos);
// printf("Bus value %d \n", atoi(&bus[pos]));
char command[50] = "timeout 5 i2cdetect -y ";
strcat (command, &bus[pos]);
FILE *i2cdetect = popen(command, "r");
@ -144,7 +144,7 @@ struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
// printf("result: %s", result);
}
int error = pclose(i2cdetect)/256;
printf("%s error: %d \n", &command, error);
// printf("%s error: %d \n", &command, error);
if (error != 0)
{
printf("ERROR: %s bus has a problem \n Check I2C wiring and pullup resistors \n", bus);

Loading…
Cancel
Save

Powered by TurnKey Linux.