diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-11-28 20:31:28 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-10 12:00:17 +0100 |
commit | 032c450d154a9b66f689328a337d30fe92b7bbb8 (patch) | |
tree | 567a1197a73cfeaa2e2e86ec944aabd3329bbfc2 | |
parent | a2b31118cb4dc01174c4c3436c29d5850d116441 (diff) | |
download | px4-firmware-032c450d154a9b66f689328a337d30fe92b7bbb8.tar.gz px4-firmware-032c450d154a9b66f689328a337d30fe92b7bbb8.tar.bz2 px4-firmware-032c450d154a9b66f689328a337d30fe92b7bbb8.zip |
lsm303d: cleanup logic traces by pre-zeroing all transfers
-rw-r--r-- | src/drivers/lsm303d/lsm303d.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index 0c0aa0ff5..576bc184e 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -1437,6 +1437,7 @@ LSM303D::measure() perf_begin(_accel_sample_perf); /* fetch data from the sensor */ + memset(&raw_accel_report, 0, sizeof(raw_accel_report)); raw_accel_report.cmd = ADDR_STATUS_A | DIR_READ | ADDR_INCREMENT; transfer((uint8_t *)&raw_accel_report, (uint8_t *)&raw_accel_report, sizeof(raw_accel_report)); @@ -1514,6 +1515,7 @@ LSM303D::mag_measure() perf_begin(_mag_sample_perf); /* fetch data from the sensor */ + memset(&raw_mag_report, 0, sizeof(raw_mag_report)); raw_mag_report.cmd = ADDR_STATUS_M | DIR_READ | ADDR_INCREMENT; transfer((uint8_t *)&raw_mag_report, (uint8_t *)&raw_mag_report, sizeof(raw_mag_report)); |