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:
Beat Küng
2017-06-14 19:53:07 +02:00
committed by Lorenz Meier
parent 19cdbcfd4f
commit ce7d8d2270
15 changed files with 35 additions and 27 deletions
+2 -2
View File
@@ -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;