From f0c0b6f6e893a1e7164b4ffc5b60dc16cb62df91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 5 Sep 2018 16:58:04 +0200 Subject: [PATCH] params: remove unused SENS_EN_* params Replaced with the more general serial config params. --- ROMFS/px4fmu_common/init.d/rc.sensors | 49 ------------------- .../distance_sensor/leddar_one/parameters.c | 42 ---------------- src/drivers/distance_sensor/sf0x/parameters.c | 7 +-- src/drivers/distance_sensor/sf0x/sf0x.cpp | 3 -- .../distance_sensor/tfmini/parameters.c | 42 ---------------- src/drivers/distance_sensor/tfmini/tfmini.cpp | 7 +-- 6 files changed, 3 insertions(+), 147 deletions(-) delete mode 100644 src/drivers/distance_sensor/leddar_one/parameters.c delete mode 100644 src/drivers/distance_sensor/tfmini/parameters.c diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 59c4ac6299..b1a22ed9a9 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -415,12 +415,6 @@ then pga460 start fi -# Lightware serial lidar sensor -if param greater SENS_EN_SF0X 0 -then - sf0x start -fi - # Lightware i2c lidar sensor if param greater SENS_EN_SF1XX 0 then @@ -439,49 +433,6 @@ then teraranger start -a fi -# Benewake TFMini -if param greater SENS_EN_TFMINI 0 -then - if ver hwcmp PX4FMU_V2 PX4FMU_V4PRO - then - # start the driver on serial 4/5 - tfmini start -d /dev/ttyS6 - else - if ver hwcmp AEROFC_V1 - then - # start the driver on telemetry - tfmini start -d /dev/ttyS3 - else - if param compare SYS_COMPANION 0 - then - # start on default mavlink companion device - tfmini start -d /dev/ttyS2 - fi - fi - fi -fi - -# LeddarOne -if param greater SENS_EN_LEDDAR1 0 -then - if ver hwcmp PX4FMU_V2 PX4FMU_V4PRO - then - # start the driver on serial 4/5 - leddar_one -d /dev/ttyS6 start - fi - if ver hwcmp AEROFC_V1 - then - # start the driver on telemetry - leddar_one -d /dev/ttyS3 start - else - if param compare SYS_COMPANION 0 - then - # start on default mavlink companion device - leddar_one -d /dev/ttyS2 start - fi - fi -fi - ############################################################################### # End Optional drivers # ############################################################################### diff --git a/src/drivers/distance_sensor/leddar_one/parameters.c b/src/drivers/distance_sensor/leddar_one/parameters.c deleted file mode 100644 index 278022b111..0000000000 --- a/src/drivers/distance_sensor/leddar_one/parameters.c +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * LeddarOne rangefinder - * - * @reboot_required true - * - * @boolean - * @group Sensors - */ -PARAM_DEFINE_INT32(SENS_EN_LEDDAR1, 0); diff --git a/src/drivers/distance_sensor/sf0x/parameters.c b/src/drivers/distance_sensor/sf0x/parameters.c index 94358b19e4..40d4c80025 100644 --- a/src/drivers/distance_sensor/sf0x/parameters.c +++ b/src/drivers/distance_sensor/sf0x/parameters.c @@ -32,17 +32,14 @@ ****************************************************************************/ /** - * Lightware laser rangefinder (serial) + * Lightware Laser Rangefinder hardware model * * @reboot_required true - * @min 0 - * @max 4 * @group Sensors - * @value 0 Disabled * @value 1 SF02 * @value 2 SF10/a * @value 3 SF10/b * @value 4 SF10/c * @value 5 SF11/c */ -PARAM_DEFINE_INT32(SENS_EN_SF0X, 0); +PARAM_DEFINE_INT32(SENS_EN_SF0X, 1); diff --git a/src/drivers/distance_sensor/sf0x/sf0x.cpp b/src/drivers/distance_sensor/sf0x/sf0x.cpp index 04dcf988c0..343cc57be6 100644 --- a/src/drivers/distance_sensor/sf0x/sf0x.cpp +++ b/src/drivers/distance_sensor/sf0x/sf0x.cpp @@ -220,9 +220,6 @@ SF0X::init() param_get(param_find("SENS_EN_SF0X"), &hw_model); switch (hw_model) { - case 0: - PX4_WARN("disabled."); - return 0; case 1: /* SF02 (40m, 12 Hz)*/ _min_distance = 0.3f; diff --git a/src/drivers/distance_sensor/tfmini/parameters.c b/src/drivers/distance_sensor/tfmini/parameters.c deleted file mode 100644 index aa9d169606..0000000000 --- a/src/drivers/distance_sensor/tfmini/parameters.c +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 PX4 Development Team. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * Benewake TFmini laser rangefinder - * - * @reboot_required true - * - * @boolean - * @group Sensors - */ -PARAM_DEFINE_INT32(SENS_EN_TFMINI, 0); diff --git a/src/drivers/distance_sensor/tfmini/tfmini.cpp b/src/drivers/distance_sensor/tfmini/tfmini.cpp index f533f70730..151b522b0b 100644 --- a/src/drivers/distance_sensor/tfmini/tfmini.cpp +++ b/src/drivers/distance_sensor/tfmini/tfmini.cpp @@ -215,14 +215,9 @@ TFMINI::~TFMINI() int TFMINI::init() { - int32_t hw_model; - param_get(param_find("SENS_EN_TFMINI"), &hw_model); + int32_t hw_model = 1; // only one model so far... switch (hw_model) { - case 0: - PX4_WARN("disabled."); - return 0; - case 1: /* TFMINI (12m, 100 Hz)*/ _min_distance = 0.3f; _max_distance = 12.0f;