Browse Source

removed stop() from I2C driver startup routines, work in progress on MPU scaling

sbg
Lorenz Meier 13 years ago
parent
commit
248bb11d93
  1. 3
      apps/drivers/hmc5883/hmc5883.cpp
  2. 10
      apps/drivers/mpu6000/mpu6000.cpp
  3. 2
      apps/drivers/ms5611/ms5611.cpp

3
apps/drivers/hmc5883/hmc5883.cpp

@ -522,9 +522,6 @@ HMC5883::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -522,9 +522,6 @@ HMC5883::ioctl(struct file *filp, int cmd, unsigned long arg)
void
HMC5883::start()
{
/* make sure we are stopped first */
stop();
/* reset the report ring and state machine */
_collect_phase = false;
_oldest_report = _next_report = 0;

10
apps/drivers/mpu6000/mpu6000.cpp

@ -831,7 +831,7 @@ MPU6000::measure() @@ -831,7 +831,7 @@ MPU6000::measure()
report.temp = (((int16_t)mpu_report.temp[0]) << 8) | mpu_report.temp[1];
report.gyro_x = ((int16_t)(mpu_report.gyro_x[0]) << 8) | mpu_report.gyro_x[1];
report.gyro_x = int16_t_from_bytes(mpu_report.gyro_x);
report.gyro_y = ((int16_t)(mpu_report.gyro_y[0]) << 8) | mpu_report.gyro_y[1];
report.gyro_z = ((int16_t)(mpu_report.gyro_z[0]) << 8) | mpu_report.gyro_z[1];
@ -839,7 +839,7 @@ MPU6000::measure() @@ -839,7 +839,7 @@ MPU6000::measure()
* Swap axes and negate y
*/
int16_t accel_xt = report.accel_y;
int16_t accel_yt = ((report.accel_x == -32768) ? 32767 : -report.accel_x);
int16_t accel_yt = report.accel_x;//((report.accel_x == -32768) ? 32767 : -report.accel_x);
int16_t gyro_xt = report.gyro_y;
int16_t gyro_yt = ((report.gyro_x == -32768) ? 32767 : -report.gyro_x);
@ -1030,9 +1030,9 @@ test() @@ -1030,9 +1030,9 @@ test()
warnx("acc x: \t%8.4f\tm/s^2", (double)a_report.x);
warnx("acc y: \t%8.4f\tm/s^2", (double)a_report.y);
warnx("acc z: \t%8.4f\tm/s^2", (double)a_report.z);
warnx("acc x: \t%d\traw", (int)a_report.x_raw);
warnx("acc y: \t%d\traw", (int)a_report.y_raw);
warnx("acc z: \t%d\traw", (int)a_report.z_raw);
warnx("acc x: \t%d\traw 0x%0x", (short)a_report.x_raw, (unsigned short)a_report.x_raw);
warnx("acc y: \t%d\traw 0x%0x", (short)a_report.y_raw, (unsigned short)a_report.y_raw);
warnx("acc z: \t%d\traw 0x%0x", (short)a_report.z_raw, (unsigned short)a_report.z_raw);
warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
(double)(a_report.range_m_s2 / 9.81f));

2
apps/drivers/ms5611/ms5611.cpp

@ -510,8 +510,6 @@ MS5611::ioctl(struct file *filp, int cmd, unsigned long arg) @@ -510,8 +510,6 @@ MS5611::ioctl(struct file *filp, int cmd, unsigned long arg)
void
MS5611::start()
{
/* make sure we are stopped first */
stop();
/* reset the report ring and state machine */
_collect_phase = false;

Loading…
Cancel
Save