mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 15:13:34 +08:00
sensor_mag.msg: add is_external flag & set it in the mag drivers
With this we don't have to use the ioctl MAGIOCGEXTERNAL, which does not work on POSIX (eg. RPi).
This commit is contained in:
@@ -1653,8 +1653,7 @@ LSM303D::mag_measure()
|
||||
} raw_mag_report;
|
||||
#pragma pack(pop)
|
||||
|
||||
mag_report mag_report;
|
||||
memset(&mag_report, 0, sizeof(mag_report));
|
||||
mag_report mag_report {};
|
||||
|
||||
/* start the performance counter */
|
||||
perf_begin(_mag_sample_perf);
|
||||
@@ -1680,6 +1679,7 @@ LSM303D::mag_measure()
|
||||
*/
|
||||
|
||||
mag_report.timestamp = hrt_absolute_time();
|
||||
mag_report.is_external = is_external();
|
||||
|
||||
mag_report.x_raw = raw_mag_report.x;
|
||||
mag_report.y_raw = raw_mag_report.y;
|
||||
|
||||
Reference in New Issue
Block a user