From d4955ed370a7d06c6b82c7da2531e2db36ebf405 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 8 Aug 2020 16:37:17 -0400 Subject: [PATCH] Update telem.c --- afsk/telem.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index a164a6e1..2d071781 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -126,24 +126,24 @@ struct SensorData read_sensor_data(struct SensorConfig sensor) { struct SensorConfig config_sensor(char *bus, int address, int milliAmps) { struct SensorConfig data; - printf("Bus size %d Bu[0] size: %d \n", strlen(bus), sizeof(bus[0]) ); // atoi(bus[(strlen(bus)/sizeof(bus[0])) - 1])); + printf("Bus lencth %d \n", atoi(bus[(strlen(bus)/sizeof(bus[0])) - 1])); FILE *i2cdetect = popen("timeout --preserve-status 5 i2cdetect -y 0", "r"); - printf("1\n"); +// printf("1\n"); pclose(i2cdetect); - printf("2\n"); +// printf("2\n"); i2cdetect = popen("echo $?", "r"); -// printf("i2cdetect 0 output: %d\n", getc(i2cdetect)); + printf("i2cdetect 0 output: %d\n", getc(i2cdetect)); int error = pclose(i2cdetect); printf("i2cdetect 0 error: %d \n", error); printf("3\n"); i2cdetect = popen("timeout --preserve-status 5 i2cdetect -y 1", "r"); - printf("4\n"); +// printf("4\n"); pclose(i2cdetect); - printf("5\n"); +// printf("5\n"); i2cdetect = popen("echo $?", "r"); -// printf("i2cdetect 1 output: %d\n", getc(i2cdetect)); + printf("i2cdetect 1 output: %d\n", getc(i2cdetect)); error = pclose(i2cdetect)/256; printf("i2cdetect 1 error: %d \n", error);