From 60c14fe8f16f0767441fc30cf473396c2c4f27ce Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Nov 2018 15:08:12 -0400 Subject: [PATCH] delete unused IOCTL GYROIOCGSAMPLERATE --- 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 | 3 --- src/drivers/imu/l3gd20/l3gd20.cpp | 3 --- src/drivers/imu/mpu6000/mpu6000.cpp | 3 --- src/drivers/imu/mpu9250/mpu9250.cpp | 3 --- src/modules/simulator/gyrosim/gyrosim.cpp | 3 --- src/systemcmds/config/config.c | 5 ++--- 11 files changed, 2 insertions(+), 33 deletions(-) diff --git a/src/drivers/drv_gyro.h b/src/drivers/drv_gyro.h index 8deb6dc494..1c65ddf6f0 100644 --- a/src/drivers/drv_gyro.h +++ b/src/drivers/drv_gyro.h @@ -76,9 +76,6 @@ struct gyro_calibration_s { #define GYRO_SAMPLERATE_DEFAULT 1000003 /**< default sample rate */ -/** return the gyro internal sample rate in Hz */ -#define GYROIOCGSAMPLERATE _GYROIOC(1) - /** set the gyro scaling constants to (arg) */ #define GYROIOCSSCALE _GYROIOC(4) diff --git a/src/drivers/imu/adis16448/adis16448.cpp b/src/drivers/imu/adis16448/adis16448.cpp index 3163fc12f1..b3096eb6c6 100644 --- a/src/drivers/imu/adis16448/adis16448.cpp +++ b/src/drivers/imu/adis16448/adis16448.cpp @@ -1117,9 +1117,6 @@ ADIS16448::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return _sample_rate; - case GYROIOCSSAMPLERATE: _set_sample_rate(arg); return OK; diff --git a/src/drivers/imu/adis16477/ADIS16477.cpp b/src/drivers/imu/adis16477/ADIS16477.cpp index cca6416d86..a8918df433 100644 --- a/src/drivers/imu/adis16477/ADIS16477.cpp +++ b/src/drivers/imu/adis16477/ADIS16477.cpp @@ -438,9 +438,6 @@ ADIS16477::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) case SENSORIOCRESET: return ioctl(filp, cmd, arg); - case GYROIOCGSAMPLERATE: - return _sample_rate; - case GYROIOCSSAMPLERATE: _set_sample_rate(arg); return OK; diff --git a/src/drivers/imu/bmi055/BMI055_gyro.cpp b/src/drivers/imu/bmi055/BMI055_gyro.cpp index 12c7fceaae..7fa9ffd639 100644 --- a/src/drivers/imu/bmi055/BMI055_gyro.cpp +++ b/src/drivers/imu/bmi055/BMI055_gyro.cpp @@ -399,9 +399,6 @@ BMI055_gyro::ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return _gyro_sample_rate; - case GYROIOCSSAMPLERATE: return gyro_set_sample_rate(arg); diff --git a/src/drivers/imu/bmi160/bmi160.cpp b/src/drivers/imu/bmi160/bmi160.cpp index 70a42df7bd..5a9e997b72 100644 --- a/src/drivers/imu/bmi160/bmi160.cpp +++ b/src/drivers/imu/bmi160/bmi160.cpp @@ -700,9 +700,6 @@ BMI160::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return _gyro_sample_rate; - case GYROIOCSSAMPLERATE: return gyro_set_sample_rate(arg); diff --git a/src/drivers/imu/fxas21002c/fxas21002c.cpp b/src/drivers/imu/fxas21002c/fxas21002c.cpp index 128550de27..f988210a3e 100644 --- a/src/drivers/imu/fxas21002c/fxas21002c.cpp +++ b/src/drivers/imu/fxas21002c/fxas21002c.cpp @@ -737,9 +737,6 @@ FXAS21002C::ioctl(struct file *filp, int cmd, unsigned long arg) case GYROIOCSSAMPLERATE: return set_samplerate(arg); - case GYROIOCGSAMPLERATE: - return _current_rate; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/l3gd20/l3gd20.cpp b/src/drivers/imu/l3gd20/l3gd20.cpp index 4ebad84048..85dd8bbe26 100644 --- a/src/drivers/imu/l3gd20/l3gd20.cpp +++ b/src/drivers/imu/l3gd20/l3gd20.cpp @@ -661,9 +661,6 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg) case GYROIOCSSAMPLERATE: return set_samplerate(arg); - case GYROIOCGSAMPLERATE: - return _current_rate; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/mpu6000/mpu6000.cpp b/src/drivers/imu/mpu6000/mpu6000.cpp index 8fd640aa3e..dbacb619da 100644 --- a/src/drivers/imu/mpu6000/mpu6000.cpp +++ b/src/drivers/imu/mpu6000/mpu6000.cpp @@ -1409,9 +1409,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return _sample_rate; - case GYROIOCSSAMPLERATE: _set_sample_rate(arg); return OK; diff --git a/src/drivers/imu/mpu9250/mpu9250.cpp b/src/drivers/imu/mpu9250/mpu9250.cpp index 5d39347273..bcfa17e21c 100644 --- a/src/drivers/imu/mpu9250/mpu9250.cpp +++ b/src/drivers/imu/mpu9250/mpu9250.cpp @@ -875,9 +875,6 @@ MPU9250::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return _sample_rate; - case GYROIOCSSAMPLERATE: _set_sample_rate(arg); return OK; diff --git a/src/modules/simulator/gyrosim/gyrosim.cpp b/src/modules/simulator/gyrosim/gyrosim.cpp index df9225c818..e1a2b58486 100644 --- a/src/modules/simulator/gyrosim/gyrosim.cpp +++ b/src/modules/simulator/gyrosim/gyrosim.cpp @@ -741,9 +741,6 @@ GYROSIM::gyro_ioctl(unsigned long cmd, unsigned long arg) return OK; } - case GYROIOCGSAMPLERATE: - return 1e6 / m_sample_interval_usecs; - case GYROIOCSSAMPLERATE: _set_sample_rate(arg); return OK; diff --git a/src/systemcmds/config/config.c b/src/systemcmds/config/config.c index c3c23b0039..5a6f9cec59 100644 --- a/src/systemcmds/config/config.c +++ b/src/systemcmds/config/config.c @@ -203,15 +203,14 @@ do_gyro(int argc, char *argv[]) return 1; } - int srate = ioctl(fd, GYROIOCGSAMPLERATE, 0); int prate = ioctl(fd, SENSORIOCGPOLLRATE, 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", - id, calibration_id, srate, prate); + PX4_INFO("gyro: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tread rate:\t%d Hz", + id, calibration_id, prate); close(fd); }