delete unused IOCTL ACCELIOCGSAMPLERATE

This commit is contained in:
Daniel Agar
2018-11-06 07:43:43 +08:00
committed by Lorenz Meier
parent f59f0d4b2d
commit 8ad59160c9
13 changed files with 2 additions and 39 deletions
-3
View File
@@ -79,9 +79,6 @@ struct accel_calibration_s {
#define ACCEL_SAMPLERATE_DEFAULT 1000003 /**< default sample rate */
/** return the accel internal sample rate in Hz */
#define ACCELIOCGSAMPLERATE _ACCELIOC(1)
/** set the accel scaling constants to the structure pointed to by (arg) */
#define ACCELIOCSSCALE _ACCELIOC(5)
-3
View File
@@ -1068,9 +1068,6 @@ ADIS16448::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return _sample_rate;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
-3
View File
@@ -407,9 +407,6 @@ ADIS16477::ioctl(struct file *filp, int cmd, unsigned long arg)
return 1000000 / _call_interval;
case ACCELIOCGSAMPLERATE:
return _sample_rate;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
-3
View File
@@ -476,9 +476,6 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg)
case ACCELIOCSSAMPLERATE: /* sensor sample rate is not (really) adjustable */
return -EINVAL;
case ACCELIOCGSAMPLERATE:
return 1200; /* always operating in low-noise mode */
case ACCELIOCSSCALE:
/* copy scale in */
memcpy(&_accel_scale, (struct accel_calibration_s *) arg, sizeof(_accel_scale));
-3
View File
@@ -415,9 +415,6 @@ BMI055_accel::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return _accel_sample_rate;
case ACCELIOCSSAMPLERATE:
return accel_set_sample_rate(arg);
-3
View File
@@ -651,9 +651,6 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return _accel_sample_rate;
case ACCELIOCSSAMPLERATE:
return accel_set_sample_rate(arg);
@@ -885,9 +885,6 @@ FXOS8701CQ::ioctl(struct file *filp, int cmd, unsigned long arg)
case ACCELIOCSSAMPLERATE:
return accel_set_samplerate(arg);
case ACCELIOCGSAMPLERATE:
return _accel_samplerate;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
-3
View File
@@ -897,9 +897,6 @@ LSM303D::ioctl(struct file *filp, int cmd, unsigned long arg)
case ACCELIOCSSAMPLERATE:
return accel_set_samplerate(arg);
case ACCELIOCGSAMPLERATE:
return _accel_samplerate;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
-3
View File
@@ -1367,9 +1367,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return _sample_rate;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
-3
View File
@@ -827,9 +827,6 @@ MPU9250::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return _sample_rate;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
@@ -569,9 +569,6 @@ ACCELSIM::devIOCTL(unsigned long cmd, unsigned long arg)
// No need to set internal sampling rate for simulator
return OK;
case ACCELIOCGSAMPLERATE:
return _accel_samplerate;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@@ -700,9 +700,6 @@ GYROSIM::devIOCTL(unsigned long cmd, unsigned long arg)
return OK;
}
case ACCELIOCGSAMPLERATE:
return 1e6 / m_sample_interval_usecs;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
+2 -3
View File
@@ -347,7 +347,6 @@ do_accel(int argc, char *argv[])
return 1;
}
int srate = ioctl(fd, ACCELIOCGSAMPLERATE, 0);
int prate = ioctl(fd, SENSORIOCGPOLLRATE, 0);
int range = ioctl(fd, ACCELIOCGRANGE, 0);
int id = ioctl(fd, DEVIOCGDEVICEID, 0);
@@ -355,8 +354,8 @@ do_accel(int argc, char *argv[])
param_get(param_find("CAL_ACC0_ID"), &(calibration_id));
PX4_INFO("accel: \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 G",
id, calibration_id, srate, prate, range);
PX4_INFO("accel: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tread rate:\t%d Hz\n\trange:\t%d G",
id, calibration_id, prate, range);
close(fd);
}