voted_sensors_update: make msl_pressure static const

This commit is contained in:
Beat Küng
2017-01-17 18:57:02 +01:00
committed by Lorenz Meier
parent e1ff6af792
commit f38843278d
2 changed files with 6 additions and 5 deletions
+5 -2
View File
@@ -50,6 +50,9 @@
using namespace sensors;
using namespace DriverFramework;
const double VotedSensorsUpdate::_msl_pressure = 101.325f;
VotedSensorsUpdate::VotedSensorsUpdate(const Parameters &parameters)
: _parameters(parameters)
{
@@ -816,10 +819,10 @@ void VotedSensorsUpdate::baro_poll(struct sensor_combined_s &raw)
const double R = 287.05; /* ideal gas constant in J/kg/K */
/* current pressure at MSL in kPa */
double p1 = _msl_pressure / 1000.0;
const double p1 = _msl_pressure;
/* measured pressure in kPa */
double p = 0.001f * _last_best_baro_pressure;
const double p = 0.001f * _last_best_baro_pressure;
/*
* Solve:
+1 -3
View File
@@ -276,9 +276,7 @@ private:
float _baro_offset[SENSOR_COUNT_MAX]; /**< offsets to be added to the raw baro pressure data after scale factor correction */
float _baro_scale[SENSOR_COUNT_MAX]; /**< scale factor corrections to be applied to the raw barp pressure data before offsets are added */
/* altitude conversion calibration */
unsigned _msl_pressure; /* in Pa */
static const double _msl_pressure; /** average sea-level pressure in kPa */
};