diff options
-rw-r--r-- | driver/accel_lis2dh.c | 3 | ||||
-rw-r--r-- | driver/accelgyro_bmi160.c | 6 | ||||
-rw-r--r-- | driver/accelgyro_lsm6dsm.c | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/driver/accel_lis2dh.c b/driver/accel_lis2dh.c index 26a2bca8d4..762ccaf4a5 100644 --- a/driver/accel_lis2dh.c +++ b/driver/accel_lis2dh.c @@ -98,8 +98,7 @@ static int set_data_rate(const struct motion_sensor_t *s, int rate, int rnd) normalized_rate = LIS2DH_REG_TO_NORMALIZE(reg_val); } - if (normalized_rate > MIN(LIS2DH_ODR_MAX_VAL, - CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ) || + if (normalized_rate > LIS2DH_ODR_MAX_VAL || normalized_rate < LIS2DH_ODR_MIN_VAL) return EC_RES_INVALID_PARAM; diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c index d07b6c0059..ecf41d32af 100644 --- a/driver/accelgyro_bmi160.c +++ b/driver/accelgyro_bmi160.c @@ -394,14 +394,12 @@ static int set_data_rate(const struct motion_sensor_t *s, switch (s->type) { case MOTIONSENSE_TYPE_ACCEL: - if (normalized_rate > MIN(BMI160_ACCEL_MAX_FREQ, - CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ) || + if (normalized_rate > BMI160_ACCEL_MAX_FREQ || normalized_rate < BMI160_ACCEL_MIN_FREQ) return EC_RES_INVALID_PARAM; break; case MOTIONSENSE_TYPE_GYRO: - if (normalized_rate > MIN(BMI160_GYRO_MAX_FREQ, - CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ) || + if (normalized_rate > BMI160_GYRO_MAX_FREQ || normalized_rate < BMI160_GYRO_MIN_FREQ) return EC_RES_INVALID_PARAM; break; diff --git a/driver/accelgyro_lsm6dsm.c b/driver/accelgyro_lsm6dsm.c index dc9a0ff5aa..af5754d2af 100644 --- a/driver/accelgyro_lsm6dsm.c +++ b/driver/accelgyro_lsm6dsm.c @@ -485,8 +485,7 @@ int lsm6dsm_set_data_rate(const struct motion_sensor_t *s, int rate, int rnd) normalized_rate = LSM6DSM_REG_TO_ODR(reg_val); } if (normalized_rate < LSM6DSM_ODR_MIN_VAL || - normalized_rate > MIN(LSM6DSM_ODR_MAX_VAL, - CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ)) + normalized_rate > LSM6DSM_ODR_MAX_VAL) return EC_RES_INVALID_PARAM; } |