diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-12-31 10:32:15 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-07 09:34:32 +0100 |
commit | d6088efd34e5482d302e3a253fdd3a170d88490a (patch) | |
tree | 04eeceef2e6203a5b643ec0ba2ad98e36467c85a /src/drivers/ms5611 | |
parent | 3be1a5182db7bd3802b77e7c03fc14f00ca218c3 (diff) | |
download | px4-firmware-d6088efd34e5482d302e3a253fdd3a170d88490a.tar.gz px4-firmware-d6088efd34e5482d302e3a253fdd3a170d88490a.tar.bz2 px4-firmware-d6088efd34e5482d302e3a253fdd3a170d88490a.zip |
ms5611: report P and T in ms5611 info
Diffstat (limited to 'src/drivers/ms5611')
-rw-r--r-- | src/drivers/ms5611/ms5611.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/ms5611/ms5611.cpp b/src/drivers/ms5611/ms5611.cpp index 87788824a..6326cf7fc 100644 --- a/src/drivers/ms5611/ms5611.cpp +++ b/src/drivers/ms5611/ms5611.cpp @@ -124,6 +124,8 @@ protected: int32_t _TEMP; int64_t _OFF; int64_t _SENS; + float _P; + float _T; /* altitude conversion calibration */ unsigned _msl_pressure; /* in kPa */ @@ -623,6 +625,8 @@ MS5611::collect() /* pressure calculation, result in Pa */ int32_t P = (((raw * _SENS) >> 21) - _OFF) >> 15; + _P = P * 0.01f; + _T = _TEMP * 0.01f; /* generate a new report */ report.temperature = _TEMP / 100.0f; @@ -695,6 +699,8 @@ MS5611::print_info() printf("TEMP: %d\n", _TEMP); printf("SENS: %lld\n", _SENS); printf("OFF: %lld\n", _OFF); + printf("P: %.3f\n", _P); + printf("T: %.3f\n", _T); printf("MSL pressure: %10.4f\n", (double)(_msl_pressure / 100.f)); printf("factory_setup %u\n", _prom.factory_setup); |