From ade52d612b1609fed0d930250c91541343d2a938 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 30 Mar 2020 15:16:37 -0400 Subject: [PATCH] lsm9ds1_mag: minor cleanup --- src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt | 2 +- src/drivers/magnetometer/lsm9ds1_mag/LSM9DS1_MAG.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt b/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt index 8c12ac8c17..2776a51aff 100644 --- a/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt +++ b/src/drivers/magnetometer/lsm9ds1_mag/CMakeLists.txt @@ -32,7 +32,7 @@ ############################################################################ px4_add_module( - MODULE drivers__mag__st__lsm9ds1_mag + MODULE drivers__magnetometer__st__lsm9ds1_mag MAIN lsm9ds1_mag SRCS lsm9ds1_mag_main.cpp diff --git a/src/drivers/magnetometer/lsm9ds1_mag/LSM9DS1_MAG.cpp b/src/drivers/magnetometer/lsm9ds1_mag/LSM9DS1_MAG.cpp index 080372fd7a..05ded8532a 100644 --- a/src/drivers/magnetometer/lsm9ds1_mag/LSM9DS1_MAG.cpp +++ b/src/drivers/magnetometer/lsm9ds1_mag/LSM9DS1_MAG.cpp @@ -44,12 +44,12 @@ LSM9DS1_MAG::LSM9DS1_MAG(I2CSPIBusOption bus_option, int bus, uint32_t device, e int bus_frequency, spi_mode_e spi_mode) : SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency), I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus), - _px4_mag(get_device_id(), ORB_PRIO_DEFAULT, rotation) + _px4_mag(get_device_id(), external() ? ORB_PRIO_VERY_HIGH : ORB_PRIO_DEFAULT, rotation) { set_device_type(DRV_MAG_DEVTYPE_ST_LSM9DS1_M); - _px4_mag.set_device_type(DRV_MAG_DEVTYPE_ST_LSM9DS1_M); - _px4_mag.set_temperature(NAN); // temperature not available + _px4_mag.set_device_type(DRV_MAG_DEVTYPE_ST_LSM9DS1_M); + _px4_mag.set_external(external()); } LSM9DS1_MAG::~LSM9DS1_MAG() @@ -203,6 +203,5 @@ void LSM9DS1_MAG::print_status() perf_print_counter(_interval_perf); perf_print_counter(_transfer_perf); perf_print_counter(_data_overrun_perf); - _px4_mag.print_status(); }