VRBRAIN / APCompass: added compass sensor init for VR Brain boards

This commit is contained in:
LukeMike 2018-02-03 14:56:02 +01:00 committed by Andrew Tridgell
parent d48f9397d0
commit 432f6c2a4a

View File

@ -656,6 +656,32 @@ void Compass::_detect_backends(void)
true, ROTATION_PITCH_180_YAW_90), AP_Compass_IST8310::name, true);
#endif
break;
case AP_BoardConfig::VRX_BOARD_BRAIN54: {
// external i2c bus
ADD_BACKEND(DRIVER_HMC5883, AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(1, HAL_COMPASS_HMC5843_I2C_ADDR),
true, ROTATION_ROLL_180),
AP_Compass_HMC5843::name, true);
}
// internal i2c bus
ADD_BACKEND(DRIVER_HMC5883, AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(0, HAL_COMPASS_HMC5843_I2C_ADDR),
false, ROTATION_YAW_270),
AP_Compass_HMC5843::name, false);
break;
case AP_BoardConfig::VRX_BOARD_BRAIN51:
case AP_BoardConfig::VRX_BOARD_BRAIN52:
case AP_BoardConfig::VRX_BOARD_BRAIN52E:
case AP_BoardConfig::VRX_BOARD_CORE10:
case AP_BoardConfig::VRX_BOARD_UBRAIN51:
case AP_BoardConfig::VRX_BOARD_UBRAIN52: {
// external i2c bus
ADD_BACKEND(DRIVER_HMC5883, AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(1, HAL_COMPASS_HMC5843_I2C_ADDR),
true, ROTATION_ROLL_180),
AP_Compass_HMC5843::name, true);
}
break;
default:
break;
}