forked from Archive/PX4-Autopilot
lsm303d: cleanup logic traces by pre-zeroing all transfers
This commit is contained in:
parent
9214154831
commit
6ba54e7035
|
@ -1299,6 +1299,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));
|
||||||
|
|
||||||
|
@ -1376,6 +1377,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));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue