From ef65e5267a5681a84a54d5f3d60df467496c0210 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Nov 2018 15:05:50 -0400 Subject: [PATCH] delete unused IOCTL GYROIOCGRANGE --- src/drivers/drv_gyro.h | 3 --- src/drivers/imu/adis16448/adis16448.cpp | 3 --- src/drivers/imu/adis16477/ADIS16477.cpp | 3 --- src/drivers/imu/bmi055/BMI055_gyro.cpp | 3 --- src/drivers/imu/bmi160/bmi160.cpp | 3 --- src/drivers/imu/fxas21002c/fxas21002c.cpp | 4 ---- src/drivers/imu/l3gd20/l3gd20.cpp | 4 ---- src/drivers/imu/mpu6000/mpu6000.cpp | 3 --- src/drivers/imu/mpu9250/mpu9250.cpp | 3 --- src/modules/simulator/gyrosim/gyrosim.cpp | 5 ----- src/systemcmds/config/config.c | 5 ++--- 11 files changed, 2 insertions(+), 37 deletions(-) diff --git a/src/drivers/drv_gyro.h b/src/drivers/drv_gyro.h index 9cf02b8288..6963a6b651 100644 --- a/src/drivers/drv_gyro.h +++ b/src/drivers/drv_gyro.h @@ -82,9 +82,6 @@ struct gyro_calibration_s { /** set the gyro scaling constants to (arg) */ #define GYROIOCSSCALE _GYROIOC(4) -/** get the current gyro measurement range in degrees per second */ -#define GYROIOCGRANGE _GYROIOC(7) - /** get the current gyro type */ #define GYROIOCTYPE _GYROIOC(13) diff --git a/src/drivers/imu/adis16448/adis16448.cpp b/src/drivers/imu/adis16448/adis16448.cpp index 0579fcebc0..4ede483025 100644 --- a/src/drivers/imu/adis16448/adis16448.cpp +++ b/src/drivers/imu/adis16448/adis16448.cpp @@ -1129,9 +1129,6 @@ ADIS16448::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - case GYROIOCTYPE: return (ADIS16448_Product); diff --git a/src/drivers/imu/adis16477/ADIS16477.cpp b/src/drivers/imu/adis16477/ADIS16477.cpp index bc2cbfc9de..cca6416d86 100644 --- a/src/drivers/imu/adis16477/ADIS16477.cpp +++ b/src/drivers/imu/adis16477/ADIS16477.cpp @@ -450,9 +450,6 @@ ADIS16477::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/bmi055/BMI055_gyro.cpp b/src/drivers/imu/bmi055/BMI055_gyro.cpp index 5beb1572e3..12c7fceaae 100644 --- a/src/drivers/imu/bmi055/BMI055_gyro.cpp +++ b/src/drivers/imu/bmi055/BMI055_gyro.cpp @@ -410,9 +410,6 @@ BMI055_gyro::ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/bmi160/bmi160.cpp b/src/drivers/imu/bmi160/bmi160.cpp index d843083e0b..70a42df7bd 100644 --- a/src/drivers/imu/bmi160/bmi160.cpp +++ b/src/drivers/imu/bmi160/bmi160.cpp @@ -711,9 +711,6 @@ BMI160::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/fxas21002c/fxas21002c.cpp b/src/drivers/imu/fxas21002c/fxas21002c.cpp index 30b17f033f..128550de27 100644 --- a/src/drivers/imu/fxas21002c/fxas21002c.cpp +++ b/src/drivers/imu/fxas21002c/fxas21002c.cpp @@ -745,10 +745,6 @@ FXAS21002C::ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - /* convert to dps and round */ - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/l3gd20/l3gd20.cpp b/src/drivers/imu/l3gd20/l3gd20.cpp index ba9045345d..4ebad84048 100644 --- a/src/drivers/imu/l3gd20/l3gd20.cpp +++ b/src/drivers/imu/l3gd20/l3gd20.cpp @@ -669,10 +669,6 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - /* convert to dps and round */ - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/mpu6000/mpu6000.cpp b/src/drivers/imu/mpu6000/mpu6000.cpp index 0121100bd4..8fd640aa3e 100644 --- a/src/drivers/imu/mpu6000/mpu6000.cpp +++ b/src/drivers/imu/mpu6000/mpu6000.cpp @@ -1421,9 +1421,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return CDev::ioctl(filp, cmd, arg); diff --git a/src/drivers/imu/mpu9250/mpu9250.cpp b/src/drivers/imu/mpu9250/mpu9250.cpp index d9975b4658..5d39347273 100644 --- a/src/drivers/imu/mpu9250/mpu9250.cpp +++ b/src/drivers/imu/mpu9250/mpu9250.cpp @@ -887,9 +887,6 @@ MPU9250::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return CDev::ioctl(filp, cmd, arg); diff --git a/src/modules/simulator/gyrosim/gyrosim.cpp b/src/modules/simulator/gyrosim/gyrosim.cpp index fd2eb64f90..df9225c818 100644 --- a/src/modules/simulator/gyrosim/gyrosim.cpp +++ b/src/modules/simulator/gyrosim/gyrosim.cpp @@ -160,7 +160,6 @@ private: struct gyro_calibration_s _gyro_scale; float _gyro_range_scale; - float _gyro_range_rad_s; perf_counter_t _accel_reads; perf_counter_t _gyro_reads; @@ -298,7 +297,6 @@ GYROSIM::GYROSIM(const char *path_accel, const char *path_gyro, enum Rotation ro _gyro_reports(nullptr), _gyro_scale{}, _gyro_range_scale(0.0f), - _gyro_range_rad_s(0.0f), _accel_reads(perf_alloc(PC_COUNT, "gyrosim_accel_read")), _gyro_reads(perf_alloc(PC_COUNT, "gyrosim_gyro_read")), _sample_perf(perf_alloc(PC_ELAPSED, "gyrosim_read")), @@ -755,9 +753,6 @@ GYROSIM::gyro_ioctl(unsigned long cmd, unsigned long arg) memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); return OK; - case GYROIOCGRANGE: - return (unsigned long)(_gyro_range_rad_s * 180.0f / M_PI_F + 0.5f); - default: /* give it to the superclass */ return VirtDevObj::devIOCTL(cmd, arg); diff --git a/src/systemcmds/config/config.c b/src/systemcmds/config/config.c index b741950055..c3c23b0039 100644 --- a/src/systemcmds/config/config.c +++ b/src/systemcmds/config/config.c @@ -205,14 +205,13 @@ do_gyro(int argc, char *argv[]) int srate = ioctl(fd, GYROIOCGSAMPLERATE, 0); int prate = ioctl(fd, SENSORIOCGPOLLRATE, 0); - int range = ioctl(fd, GYROIOCGRANGE, 0); int id = ioctl(fd, DEVIOCGDEVICEID, 0); int32_t calibration_id = 0; param_get(param_find("CAL_GYRO0_ID"), &(calibration_id)); - PX4_INFO("gyro: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tsample rate:\t%d Hz\n\tread rate:\t%d Hz\n\trange:\t%d dps", - id, calibration_id, srate, prate, range); + PX4_INFO("gyro: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tsample rate:\t%d Hz\n\tread rate:\t%d Hz", + id, calibration_id, srate, prate); close(fd); }