From 13ee34c58ac805f4f2969845a762dfc417c8ac6a Mon Sep 17 00:00:00 2001 From: mirkix Date: Thu, 9 Apr 2015 12:46:25 +0200 Subject: [PATCH] AP_InertialSensor: MPU9150 fix compiler warnings --- .../AP_InertialSensor/AP_InertialSensor_MPU9150.cpp | 10 +++++----- .../AP_InertialSensor/AP_InertialSensor_MPU9150.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp index e44eed3a8f..bd423c4ad9 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp @@ -400,9 +400,9 @@ bool AP_InertialSensor_MPU9150::_init_sensor(void) hal.console->printf("AP_InertialSensor_MPU9150: couldn't read the registers to determine revision"); goto failed; } - uint8_t rev; - rev = ((buff[5] & 0x01) << 2) | ((buff[3] & 0x01) << 1) | - (buff[1] & 0x01); + // uint8_t rev; + // rev = ((buff[5] & 0x01) << 2) | ((buff[3] & 0x01) << 1) | + // (buff[1] & 0x01); // Do not do the checking, for some reason the MPU-9150 returns 0 // if (rev) { @@ -954,7 +954,7 @@ int16_t AP_InertialSensor_MPU9150::mpu_set_int_latched(uint8_t enable) * @param[out] more Number of remaining packets. * @return 0 if successful. */ -int16_t AP_InertialSensor_MPU9150::mpu_read_fifo(int16_t *gyro, int16_t *accel, uint32_t timestamp, +int16_t AP_InertialSensor_MPU9150::mpu_read_fifo(int16_t *gyro, int16_t *accel, uint32_t *timestamp, uint8_t *sensors, uint8_t *more) { /* Assumes maximum packet size is gyro (6) + accel (6). */ @@ -984,7 +984,7 @@ int16_t AP_InertialSensor_MPU9150::mpu_read_fifo(int16_t *gyro, int16_t *accel, } } - timestamp = hal.scheduler->millis(); + *timestamp = hal.scheduler->millis(); // read the data hal.i2c->readRegisters(st.hw->addr, st.reg->fifo_r_w, packet_size, data); more[0] = fifo_count / packet_size - 1; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h index e481091660..ffb30d6770 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h @@ -47,7 +47,7 @@ private: int16_t mpu_reset_fifo(uint8_t sensors); int16_t mpu_set_sensors(uint8_t sensors); int16_t mpu_set_int_latched(uint8_t enable); - int16_t mpu_read_fifo(int16_t *gyro, int16_t *accel, uint32_t timestamp, uint8_t *sensors, uint8_t *more); + int16_t mpu_read_fifo(int16_t *gyro, int16_t *accel, uint32_t *timestamp, uint8_t *sensors, uint8_t *more); void _set_accel_filter_frequency(uint8_t filter_hz); void _set_gyro_filter_frequency(uint8_t filter_hz);