Browse Source

AP_InertialSensor: added paranoid check for DRDY pin

master
Andrew Tridgell 11 years ago
parent
commit
d1ba78002d
  1. 7
      libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

7
libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

@ -392,6 +392,13 @@ void AP_InertialSensor_MPU9250::_read_data_transaction() { @@ -392,6 +392,13 @@ void AP_InertialSensor_MPU9250::_read_data_transaction() {
_spi->transaction((const uint8_t *)&tx, (uint8_t *)&rx, sizeof(rx));
if (_drdy_pin) {
if (_drdy_pin->read() != 0) {
// data ready should have gone low after a read
printf("MPU9250: DRDY didn't go low\n");
}
}
/*
detect a bad SPI bus transaction by looking for all 14 bytes
zero, or the wrong INT_STATUS register value. This is used to

Loading…
Cancel
Save