From 7244ac188df3e51c15fe7df6b50f4fccc6eaedb8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 20 Jul 2019 08:52:29 -0400 Subject: [PATCH] fixes --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 21fe3145..d70dfbaf 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -403,13 +403,13 @@ int get_tlm(int tlm[][5]) { } // read i2c current sensors // - double x_current = 0, power = 0, y_current = 0, y_power = 0, z_current = 0, z_power = 0; + double x_current = 0, x_power = 0, y_current = 0, y_power = 0, z_current = 0, z_power = 0; if (x_fd != -1) { wiringPiI2CWriteReg16(x_fd, INA219_REG_CALIBRATION, x_calValue); wiringPiI2CWriteReg16(x_fd, INA219_REG_CONFIG, config); wiringPiI2CWriteReg16(x_fd, INA219_REG_CALIBRATION, x_calValue); x_current = wiringPiI2CReadReg16(x_fd, INA219_REG_CURRENT) / x_currentDivider; - power = wiringPiI2CReadReg16(x_fd, INA219_REG_POWER) * x_powerMultiplier; + x_power = wiringPiI2CReadReg16(x_fd, INA219_REG_POWER) * x_powerMultiplier; wiringPiI2CWriteReg16(y_fd, INA219_REG_CALIBRATION, x_calValue); wiringPiI2CWriteReg16(y_fd, INA219_REG_CONFIG, config); @@ -425,8 +425,8 @@ int get_tlm(int tlm[][5]) { } #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", - current, - power, + x_current, + x_power, y_current, y_power, z_current,