mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 02:33:34 +08:00
stop manually defining physical constants
This commit is contained in:
committed by
Lorenz Meier
parent
7538ea44e3
commit
d75fd72c02
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user