stop manually defining physical constants

This commit is contained in:
Daniel Agar
2018-04-19 07:24:58 +02:00
committed by Lorenz Meier
parent 7538ea44e3
commit d75fd72c02
27 changed files with 66 additions and 84 deletions
+2 -1
View File
@@ -44,6 +44,7 @@
#include <float.h>
#include <stdio.h>
#include <string.h>
#include <ecl/geo/geo.h>
#include <drivers/device/i2c.h>
#include <drivers/device/ringbuffer.h>
@@ -555,7 +556,7 @@ BATT_SMBUS::cycle()
// read battery temperature and covert to Celsius
if (read_reg(BATT_SMBUS_TEMP, tmp) == OK) {
new_report.temperature = (float)(((float)tmp / 10.0f) - 273.15f);
new_report.temperature = (float)(((float)tmp / 10.0f) + CONSTANTS_ABSOLUTE_NULL_CELSIUS);
}
//Check if remaining % is out of range