stop manually defining physical constants

This commit is contained in:
Daniel Agar
2018-04-19 07:24:58 +02:00
committed by Lorenz Meier
parent 7538ea44e3
commit d75fd72c02
27 changed files with 66 additions and 84 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
#include "bmi160.hpp"
#include "bmi160_gyro.hpp"
#include <ecl/geo/geo.h>
/*
list of registers that will be checked in check_registers(). Note
@@ -743,7 +743,7 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
return set_accel_range(arg);
case ACCELIOCGRANGE:
return (unsigned long)((_accel_range_m_s2) / BMI160_ONE_G + 0.5f);
return (unsigned long)((_accel_range_m_s2) / CONSTANTS_ONE_G + 0.5f);
case ACCELIOCSELFTEST:
return accel_self_test();
@@ -905,8 +905,8 @@ BMI160::set_accel_range(unsigned max_g)
return -EINVAL;
}
_accel_range_scale = (BMI160_ONE_G / lsb_per_g);
_accel_range_m_s2 = max_accel_g * BMI160_ONE_G;
_accel_range_scale = (CONSTANTS_ONE_G / lsb_per_g);
_accel_range_m_s2 = max_accel_g * CONSTANTS_ONE_G;
modify_reg(BMIREG_ACC_RANGE, clearbits, setbits);