From a791adf3b9e64b580412bdfddedde437390418fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 7 Dec 2017 17:26:34 +0100 Subject: [PATCH] ist8310: enable internal/external distinction --- src/drivers/ist8310/ist8310.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/ist8310/ist8310.cpp b/src/drivers/ist8310/ist8310.cpp index 5963cff637..3f6332af69 100644 --- a/src/drivers/ist8310/ist8310.cpp +++ b/src/drivers/ist8310/ist8310.cpp @@ -752,7 +752,7 @@ IST8310::ioctl(struct file *filp, int cmd, unsigned long arg) case MAGIOCGEXTERNAL: DEVICE_DEBUG("MAGIOCGEXTERNAL in main driver"); - return 1; + return external(); default: /* give it to the superclass */ @@ -909,7 +909,7 @@ IST8310::collect() perf_begin(_sample_perf); struct mag_report new_report; - bool sensor_is_onboard = false; + const bool sensor_is_external = external(); float xraw_f; float yraw_f; @@ -917,7 +917,7 @@ IST8310::collect() /* this should be fairly close to the end of the measurement, so the best approximation of the time */ new_report.timestamp = hrt_absolute_time(); - new_report.is_external = !sensor_is_onboard; + new_report.is_external = sensor_is_external; new_report.error_count = perf_event_count(_comms_errors); new_report.scaling = _range_scale; new_report.device_id = _device_id.devid; @@ -988,7 +988,7 @@ IST8310::collect() } else { _mag_topic = orb_advertise_multi(ORB_ID(sensor_mag), &new_report, - &_orb_class_instance, (sensor_is_onboard) ? ORB_PRIO_HIGH : ORB_PRIO_MAX); + &_orb_class_instance, sensor_is_external ? ORB_PRIO_MAX : ORB_PRIO_HIGH); if (_mag_topic == nullptr) { DEVICE_DEBUG("ADVERT FAIL");