drivers: re-use calibration topic

E.g. instead of defining a gyro_scale struct in drv_gyro.h, use the
gyro_calibration message.
This commit is contained in:
Julian Oes
2016-03-24 13:08:30 +01:00
parent 98e407696e
commit b9cc0b74e2
16 changed files with 343 additions and 129 deletions
+14 -16
View File
@@ -1075,23 +1075,21 @@ int HMC5883::calibrate(struct file *filp, unsigned enable)
// XXX do something smarter here
int fd = (int)enable;
struct mag_scale mscale_previous = {
0.0f,
1.0f,
0.0f,
1.0f,
0.0f,
1.0f,
};
struct mag_calibration_s mscale_previous;
mscale_previous.x_offset = 0.0f,
mscale_previous.x_scale = 1.0f,
mscale_previous.y_offset = 0.0f,
mscale_previous.y_scale = 1.0f,
mscale_previous.z_offset = 0.0f,
mscale_previous.z_scale = 1.0f,
struct mag_scale mscale_null = {
0.0f,
1.0f,
0.0f,
1.0f,
0.0f,
1.0f,
};
struct mag_calibration_s mscale_null;
mscale_null.x_offset = 0.0f,
mscale_null.x_scale = 1.0f,
mscale_null.y_offset = 0.0f,
mscale_null.y_scale = 1.0f,
mscale_null.z_offset = 0.0f,
mscale_null.z_scale = 1.0f,
float sum_excited[3] = {0.0f, 0.0f, 0.0f};