delete unused IOCTLs ACCELIOCSSAMPLERATE and ACCEL_SAMPLERATE_DEFAULT

This commit is contained in:
Daniel Agar 2018-11-03 14:38:14 -04:00 committed by Lorenz Meier
parent eddbd3fc4b
commit e759e0e1a5
13 changed files with 6 additions and 64 deletions

View File

@ -73,12 +73,6 @@ struct accel_calibration_s {
#define _ACCELIOCBASE (0x2100)
#define _ACCELIOC(_n) (_PX4_IOC(_ACCELIOCBASE, _n))
/** set the accel internal sample rate to at least (arg) Hz */
#define ACCELIOCSSAMPLERATE _ACCELIOC(0)
#define ACCEL_SAMPLERATE_DEFAULT 1000003 /**< default sample rate */
/** set the accel scaling constants to the structure pointed to by (arg) */
#define ACCELIOCSSCALE _ACCELIOC(5)

View File

@ -1068,10 +1068,6 @@ ADIS16448::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -407,10 +407,6 @@ ADIS16477::ioctl(struct file *filp, int cmd, unsigned long arg)
return 1000000 / _call_interval;
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -473,9 +473,6 @@ BMA180::ioctl(struct file *filp, int cmd, unsigned long arg)
/* XXX implement */
return -EINVAL;
case ACCELIOCSSAMPLERATE: /* sensor sample rate is not (really) adjustable */
return -EINVAL;
case ACCELIOCSSCALE:
/* copy scale in */
memcpy(&_accel_scale, (struct accel_calibration_s *) arg, sizeof(_accel_scale));

View File

@ -415,9 +415,6 @@ BMI055_accel::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
return accel_set_sample_rate(arg);
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -651,9 +651,6 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
return accel_set_sample_rate(arg);
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -882,9 +882,6 @@ FXOS8701CQ::ioctl(struct file *filp, int cmd, unsigned long arg)
reset();
return OK;
case ACCELIOCSSAMPLERATE:
return accel_set_samplerate(arg);
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -1137,7 +1134,7 @@ FXOS8701CQ::accel_set_samplerate(unsigned frequency)
uint8_t active = read_reg(FXOS8701CQ_CTRL_REG1) & CTRL_REG1_ACTIVE;
if (frequency == 0 || frequency == ACCEL_SAMPLERATE_DEFAULT) {
if (frequency == 0) {
frequency = FXOS8701C_ACCEL_DEFAULT_RATE;
}

View File

@ -894,9 +894,6 @@ LSM303D::ioctl(struct file *filp, int cmd, unsigned long arg)
reset();
return OK;
case ACCELIOCSSAMPLERATE:
return accel_set_samplerate(arg);
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;
@ -1214,7 +1211,7 @@ LSM303D::accel_set_samplerate(unsigned frequency)
uint8_t setbits = 0;
uint8_t clearbits = REG1_RATE_BITS_A;
if (frequency == 0 || frequency == ACCEL_SAMPLERATE_DEFAULT) {
if (frequency == 0) {
frequency = 1600;
}

View File

@ -909,8 +909,7 @@ void
MPU6000::_set_sample_rate(unsigned desired_sample_rate_hz)
{
if (desired_sample_rate_hz == 0 ||
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT ||
desired_sample_rate_hz == ACCEL_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz = MPU6000_GYRO_DEFAULT_RATE;
}
@ -1367,10 +1366,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -553,8 +553,7 @@ void
MPU9250::_set_sample_rate(unsigned desired_sample_rate_hz)
{
if (desired_sample_rate_hz == 0 ||
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT ||
desired_sample_rate_hz == ACCEL_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz = MPU9250_GYRO_DEFAULT_RATE;
}
@ -827,10 +826,6 @@ MPU9250::ioctl(struct file *filp, int cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -565,10 +565,6 @@ ACCELSIM::devIOCTL(unsigned long cmd, unsigned long arg)
// Nothing to do for simulator
return OK;
case ACCELIOCSSAMPLERATE:
// No need to set internal sampling rate for simulator
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -513,8 +513,7 @@ GYROSIM::_set_sample_rate(unsigned desired_sample_rate_hz)
PX4_DEBUG("_set_sample_rate %u Hz", desired_sample_rate_hz);
if (desired_sample_rate_hz == 0 ||
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT ||
desired_sample_rate_hz == ACCEL_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz == GYRO_SAMPLERATE_DEFAULT) {
desired_sample_rate_hz = GYROSIM_GYRO_DEFAULT_RATE;
}
@ -700,10 +699,6 @@ GYROSIM::devIOCTL(unsigned long cmd, unsigned long arg)
return OK;
}
case ACCELIOCSSAMPLERATE:
_set_sample_rate(arg);
return OK;
case ACCELIOCSSCALE: {
/* copy scale, but only if off by a few percent */
struct accel_calibration_s *s = (struct accel_calibration_s *) arg;

View File

@ -312,17 +312,7 @@ do_accel(int argc, char *argv[])
int ret;
if (argc == 3 && !strcmp(argv[0], "sampling")) {
/* set the accel internal sampling rate up to at least i Hz */
ret = ioctl(fd, ACCELIOCSSAMPLERATE, 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));