diff --git a/src/drivers/bmi160/bmi160.cpp b/src/drivers/bmi160/bmi160.cpp index 91a11f5a14..9f6289039c 100644 --- a/src/drivers/bmi160/bmi160.cpp +++ b/src/drivers/bmi160/bmi160.cpp @@ -504,31 +504,6 @@ BMI160::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 1; - } - return 0; } diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index e0678a84e4..e109d1d0df 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -1127,31 +1127,6 @@ LSM303D::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 1; - } - return 0; } diff --git a/src/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp index 4d385f1e99..2bb79f79f4 100644 --- a/src/drivers/mpu6000/mpu6000.cpp +++ b/src/drivers/mpu6000/mpu6000.cpp @@ -1052,31 +1052,6 @@ MPU6000::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 1; - } - return 0; } diff --git a/src/drivers/mpu6500/mpu6500.cpp b/src/drivers/mpu6500/mpu6500.cpp index 0d1ae228c0..03dc6e2a95 100644 --- a/src/drivers/mpu6500/mpu6500.cpp +++ b/src/drivers/mpu6500/mpu6500.cpp @@ -905,31 +905,6 @@ MPU6500::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 1; - } - return 0; } diff --git a/src/drivers/mpu9250/mpu9250.cpp b/src/drivers/mpu9250/mpu9250.cpp index 3280a50078..7b569639b1 100644 --- a/src/drivers/mpu9250/mpu9250.cpp +++ b/src/drivers/mpu9250/mpu9250.cpp @@ -592,31 +592,6 @@ MPU9250::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 2; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 3; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 4; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 5; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 6; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 7; - } - return 0; } diff --git a/src/platforms/posix/drivers/gyrosim/gyrosim.cpp b/src/platforms/posix/drivers/gyrosim/gyrosim.cpp index b78f7d00d3..8570a200d0 100644 --- a/src/platforms/posix/drivers/gyrosim/gyrosim.cpp +++ b/src/platforms/posix/drivers/gyrosim/gyrosim.cpp @@ -618,31 +618,6 @@ GYROSIM::accel_self_test() return 1; } - /* inspect accel offsets */ - if (fabsf(_accel_scale.x_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.x_scale - 1.0f) > 0.4f || fabsf(_accel_scale.x_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.y_scale - 1.0f) > 0.4f || fabsf(_accel_scale.y_scale - 1.0f) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_offset) < 0.000001f) { - return 1; - } - - if (fabsf(_accel_scale.z_scale - 1.0f) > 0.4f || fabsf(_accel_scale.z_scale - 1.0f) < 0.000001f) { - return 1; - } - return 0; }