mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 23:43:34 +08:00
lsm303d: cleanup logic traces by pre-zeroing all transfers
This commit is contained in:
committed by
Lorenz Meier
parent
a2b31118cb
commit
032c450d15
@@ -1437,6 +1437,7 @@ LSM303D::measure()
|
|||||||
perf_begin(_accel_sample_perf);
|
perf_begin(_accel_sample_perf);
|
||||||
|
|
||||||
/* fetch data from the sensor */
|
/* 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;
|
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));
|
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);
|
perf_begin(_mag_sample_perf);
|
||||||
|
|
||||||
/* fetch data from the sensor */
|
/* 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;
|
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));
|
transfer((uint8_t *)&raw_mag_report, (uint8_t *)&raw_mag_report, sizeof(raw_mag_report));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user