diff options
author | Julian Oes <julian@oes.ch> | 2013-08-21 08:40:51 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2013-08-21 08:40:51 +0200 |
commit | 408b29ba618e1c2c7375d6acd488c223d796186f (patch) | |
tree | 3228a83520dc7bba90147b626659dbf2946aa1bd /src/drivers | |
parent | f5c92314f16fde650ee6f2f4fa20b7c2680a4b00 (diff) | |
download | px4-firmware-408b29ba618e1c2c7375d6acd488c223d796186f.tar.gz px4-firmware-408b29ba618e1c2c7375d6acd488c223d796186f.tar.bz2 px4-firmware-408b29ba618e1c2c7375d6acd488c223d796186f.zip |
Don't store m/s^2 and G at the same time
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/lsm303d/lsm303d.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index 8d6dc0672..2b7769992 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -220,7 +220,6 @@ private: struct accel_scale _accel_scale; unsigned _accel_range_g; - float _accel_range_m_s2; float _accel_range_scale; unsigned _accel_samplerate; unsigned _accel_filter_bandwith; @@ -420,7 +419,6 @@ LSM303D::LSM303D(int bus, const char* path, spi_dev_e device) : _oldest_mag_report(0), _mag_reports(nullptr), _accel_range_g(8), - _accel_range_m_s2(0.0f), _accel_range_scale(0.0f), _accel_samplerate(800), _accel_filter_bandwith(50), @@ -1029,7 +1027,6 @@ LSM303D::accel_set_range(unsigned max_g) return -EINVAL; } - _accel_range_m_s2 = _accel_range_g * 9.80665f; _accel_range_scale = new_scale_g_digit * 9.80665f; modify_reg(ADDR_CTRL_REG2, clearbits, setbits); @@ -1275,7 +1272,7 @@ LSM303D::measure() accel_report->z = _accel_filter_z.apply(z_in_new); accel_report->scaling = _accel_range_scale; - accel_report->range_m_s2 = _accel_range_m_s2; + accel_report->range_m_s2 = _accel_range_g * 9.80665f; /* post a report to the ring - note, not locked */ INCREMENT(_next_accel_report, _num_accel_reports); |