diff --git a/afsk/main.c b/afsk/main.c index 79323b2c..58f90813 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -117,11 +117,11 @@ struct SensorData read_sensor_data(int sensor) { return data; } - wiringPiI2CWriteReg16(sensor, INA219_REG_CALIBRATION, x_calValue); - wiringPiI2CWriteReg16(sensor, INA219_REG_CONFIG, config); - wiringPiI2CWriteReg16(sensor, INA219_REG_CALIBRATION, x_calValue); - data.current = wiringPiI2CReadReg16(sensor, INA219_REG_CURRENT) / x_currentDivider; - data.power = wiringPiI2CReadReg16(sensor, INA219_REG_POWER) * x_powerMultiplier; + wiringPiI2CWriteReg16(sensor, INA219_REG_CALIBRATION, x_calValue); + wiringPiI2CWriteReg16(sensor, INA219_REG_CONFIG, config); + wiringPiI2CWriteReg16(sensor, INA219_REG_CALIBRATION, x_calValue); + data.current = wiringPiI2CReadReg16(sensor, INA219_REG_CURRENT) / x_currentDivider; + data.power = wiringPiI2CReadReg16(sensor, INA219_REG_POWER) * x_powerMultiplier; return data; }