From 3daf37433e2154c1308ac1bdaaba4676d2bd9684 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Nov 2018 15:09:37 -0400 Subject: [PATCH] delete unused IOCTL GYROIOCSSAMPLERATE --- src/drivers/drv_gyro.h | 3 --- src/drivers/imu/adis16448/adis16448.cpp | 4 ---- src/drivers/imu/adis16477/ADIS16477.cpp | 4 ---- 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 | 4 ---- src/drivers/imu/mpu9250/mpu9250.cpp | 4 ---- src/modules/simulator/gyrosim/gyrosim.cpp | 4 ---- src/systemcmds/config/config.c | 12 +----------- 11 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/drivers/drv_gyro.h b/src/drivers/drv_gyro.h index 1c65ddf6f0..b82ece5449 100644 --- a/src/drivers/drv_gyro.h +++ b/src/drivers/drv_gyro.h @@ -71,9 +71,6 @@ struct gyro_calibration_s { #define _GYROIOCBASE (0x2300) #define _GYROIOC(_n) (_PX4_IOC(_GYROIOCBASE, _n)) -/** set the gyro internal sample rate to at least (arg) Hz */ -#define GYROIOCSSAMPLERATE _GYROIOC(0) - #define GYRO_SAMPLERATE_DEFAULT 1000003 /**< default sample rate */ /** set the gyro scaling constants to (arg) */ diff --git a/src/drivers/imu/adis16448/adis16448.cpp b/src/drivers/imu/adis16448/adis16448.cpp index b3096eb6c6..d77c0c4aa2 100644 --- a/src/drivers/imu/adis16448/adis16448.cpp +++ b/src/drivers/imu/adis16448/adis16448.cpp @@ -1117,10 +1117,6 @@ ADIS16448::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCSSAMPLERATE: - _set_sample_rate(arg); - return OK; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/adis16477/ADIS16477.cpp b/src/drivers/imu/adis16477/ADIS16477.cpp index a8918df433..a63afd932d 100644 --- a/src/drivers/imu/adis16477/ADIS16477.cpp +++ b/src/drivers/imu/adis16477/ADIS16477.cpp @@ -438,10 +438,6 @@ ADIS16477::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) case SENSORIOCRESET: return ioctl(filp, cmd, arg); - case GYROIOCSSAMPLERATE: - _set_sample_rate(arg); - return OK; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/bmi055/BMI055_gyro.cpp b/src/drivers/imu/bmi055/BMI055_gyro.cpp index 7fa9ffd639..c5bff425d9 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 GYROIOCSSAMPLERATE: - return gyro_set_sample_rate(arg); - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/bmi160/bmi160.cpp b/src/drivers/imu/bmi160/bmi160.cpp index 5a9e997b72..483e3f3002 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 GYROIOCSSAMPLERATE: - return gyro_set_sample_rate(arg); - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/fxas21002c/fxas21002c.cpp b/src/drivers/imu/fxas21002c/fxas21002c.cpp index f988210a3e..caa02e57b8 100644 --- a/src/drivers/imu/fxas21002c/fxas21002c.cpp +++ b/src/drivers/imu/fxas21002c/fxas21002c.cpp @@ -734,9 +734,6 @@ FXAS21002C::ioctl(struct file *filp, int cmd, unsigned long arg) reset(); return OK; - case GYROIOCSSAMPLERATE: - return set_samplerate(arg); - 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 85dd8bbe26..6d2e3626c7 100644 --- a/src/drivers/imu/l3gd20/l3gd20.cpp +++ b/src/drivers/imu/l3gd20/l3gd20.cpp @@ -658,9 +658,6 @@ L3GD20::ioctl(struct file *filp, int cmd, unsigned long arg) reset(); return OK; - case GYROIOCSSAMPLERATE: - return set_samplerate(arg); - 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 dbacb619da..a350f6d7ed 100644 --- a/src/drivers/imu/mpu6000/mpu6000.cpp +++ b/src/drivers/imu/mpu6000/mpu6000.cpp @@ -1409,10 +1409,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCSSAMPLERATE: - _set_sample_rate(arg); - return OK; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/drivers/imu/mpu9250/mpu9250.cpp b/src/drivers/imu/mpu9250/mpu9250.cpp index bcfa17e21c..f678b7a450 100644 --- a/src/drivers/imu/mpu9250/mpu9250.cpp +++ b/src/drivers/imu/mpu9250/mpu9250.cpp @@ -875,10 +875,6 @@ MPU9250::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) return OK; } - case GYROIOCSSAMPLERATE: - _set_sample_rate(arg); - return OK; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/modules/simulator/gyrosim/gyrosim.cpp b/src/modules/simulator/gyrosim/gyrosim.cpp index e1a2b58486..a33a112dbd 100644 --- a/src/modules/simulator/gyrosim/gyrosim.cpp +++ b/src/modules/simulator/gyrosim/gyrosim.cpp @@ -741,10 +741,6 @@ GYROSIM::gyro_ioctl(unsigned long cmd, unsigned long arg) return OK; } - case GYROIOCSSAMPLERATE: - _set_sample_rate(arg); - return OK; - case GYROIOCSSCALE: /* copy scale in */ memcpy(&_gyro_scale, (struct gyro_calibration_s *) arg, sizeof(_gyro_scale)); diff --git a/src/systemcmds/config/config.c b/src/systemcmds/config/config.c index 5a6f9cec59..da2543568e 100644 --- a/src/systemcmds/config/config.c +++ b/src/systemcmds/config/config.c @@ -178,17 +178,7 @@ do_gyro(int argc, char *argv[]) int ret; - if (argc == 3 && !strcmp(argv[0], "sampling")) { - - /* set the gyro internal sampling rate up to at least i Hz */ - ret = ioctl(fd, GYROIOCSSAMPLERATE, strtoul(argv[2], NULL, 0)); - - if (ret) { - PX4_ERR("sampling rate could not be set"); - return 1; - } - - } else if (argc == 3 && !strcmp(argv[0], "rate")) { + if (argc == 3 && !strcmp(argv[0], "rate")) { /* set the driver to poll at i Hz */ ret = ioctl(fd, SENSORIOCSPOLLRATE, strtoul(argv[2], NULL, 0));