forked from Archive/PX4-Autopilot
removed stop() from I2C driver startup routines, work in progress on MPU scaling
This commit is contained in:
parent
58b51743f2
commit
248bb11d93
|
@ -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;
|
||||
|
|
|
@ -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()
|
|||
* 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()
|
|||
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));
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue