|
|
|
|
@ -193,11 +193,11 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
y_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x41);
|
|
|
|
|
z_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x44);
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOGGING
|
|
|
|
|
// #ifdef DEBUG_LOGGING
|
|
|
|
|
fprintf(stderr, "Opening of -X fd %d\n", x_fd);
|
|
|
|
|
fprintf(stderr, "Opening of -Y fd %d\n", y_fd);
|
|
|
|
|
fprintf(stderr, "Opening of -Z fd %d\n", z_fd);
|
|
|
|
|
#endif
|
|
|
|
|
// #endif
|
|
|
|
|
#endif
|
|
|
|
|
int test;
|
|
|
|
|
if (((test = open("/dev/i2c-1", O_RDWR))) > 0) // Test if I2C Bus 1 is present
|
|
|
|
|
@ -428,7 +428,7 @@ int get_tlm(int tlm[][5]) {
|
|
|
|
|
z_current = wiringPiI2CReadReg16(z_fd, INA219_REG_CURRENT) / x_currentDivider;
|
|
|
|
|
z_power = wiringPiI2CReadReg16(z_fd, INA219_REG_POWER) * x_powerMultiplier;
|
|
|
|
|
}
|
|
|
|
|
#ifdef DEBUG_LOGGING
|
|
|
|
|
// #ifdef DEBUG_LOGGING
|
|
|
|
|
printf("-X 0x40 current %4.2f power %4.2f -Y 0x41 current %4.2f power %4.2f -Z 0x44 current %4.2f power %4.2f \n",
|
|
|
|
|
x_current,
|
|
|
|
|
x_power,
|
|
|
|
|
@ -437,7 +437,7 @@ int get_tlm(int tlm[][5]) {
|
|
|
|
|
z_current,
|
|
|
|
|
z_power);
|
|
|
|
|
printf("1B: ina219[%d]: %s val: %f \n", SENSOR_40 + CURRENTV, ina219[SENSOR_40 + CURRENTV], strtof(ina219[SENSOR_40 + CURRENTV], NULL));
|
|
|
|
|
#endif
|
|
|
|
|
// #endif
|
|
|
|
|
#endif
|
|
|
|
|
int count;
|
|
|
|
|
for (count = 0; count < 7; count++)
|
|
|
|
|
|