Browse Source

AP_Compass: Added support for internal i2c bus to VRBrain-v51

Now the internal compass HMC5883 of the VRBrain-v51 is correctly recognized

Co-authored-by: Pierre Kancir <pierre.kancir.emn@gmail.com>
zr-v5.1
Marko 6 years ago committed by Andrew Tridgell
parent
commit
00d0fe876d
  1. 11
      libraries/AP_Compass/AP_Compass.cpp

11
libraries/AP_Compass/AP_Compass.cpp

@ -1246,17 +1246,18 @@ void Compass::_detect_backends(void)
ADD_BACKEND(DRIVER_BMM150, ADD_BACKEND(DRIVER_BMM150,
AP_Compass_BMM150::probe(GET_I2C_DEVICE(0, 0x10), false, ROTATION_NONE)); AP_Compass_BMM150::probe(GET_I2C_DEVICE(0, 0x10), false, ROTATION_NONE));
break; break;
case AP_BoardConfig::VRX_BOARD_BRAIN54: { case AP_BoardConfig::VRX_BOARD_BRAIN54:
case AP_BoardConfig::VRX_BOARD_BRAIN51: {
// external i2c bus // external i2c bus
ADD_BACKEND(DRIVER_HMC5843, AP_Compass_HMC5843::probe(GET_I2C_DEVICE(1, HAL_COMPASS_HMC5843_I2C_ADDR), ADD_BACKEND(DRIVER_HMC5843, AP_Compass_HMC5843::probe(GET_I2C_DEVICE(1, HAL_COMPASS_HMC5843_I2C_ADDR),
true, ROTATION_ROLL_180)); true, ROTATION_ROLL_180));
}
// internal i2c bus // internal i2c bus
ADD_BACKEND(DRIVER_HMC5843, AP_Compass_HMC5843::probe(GET_I2C_DEVICE(0, HAL_COMPASS_HMC5843_I2C_ADDR), ADD_BACKEND(DRIVER_HMC5843, AP_Compass_HMC5843::probe(GET_I2C_DEVICE(0, HAL_COMPASS_HMC5843_I2C_ADDR),
false, ROTATION_YAW_270)); false, ROTATION_YAW_270));
}
break; break;
case AP_BoardConfig::VRX_BOARD_BRAIN51:
case AP_BoardConfig::VRX_BOARD_BRAIN52: case AP_BoardConfig::VRX_BOARD_BRAIN52:
case AP_BoardConfig::VRX_BOARD_BRAIN52E: case AP_BoardConfig::VRX_BOARD_BRAIN52E:
case AP_BoardConfig::VRX_BOARD_CORE10: case AP_BoardConfig::VRX_BOARD_CORE10:

Loading…
Cancel
Save