mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Compass: probe for LIS3MDL on 0x1e
as well as 0x1c
This commit is contained in:
parent
031166f64d
commit
5ad64b8656
@ -610,6 +610,13 @@ void Compass::_detect_backends(void)
|
|||||||
ADD_BACKEND(DRIVER_LIS3MDL, AP_Compass_LIS3MDL::probe(*this, hal.i2c_mgr->get_device(0, HAL_COMPASS_LIS3MDL_I2C_ADDR),
|
ADD_BACKEND(DRIVER_LIS3MDL, AP_Compass_LIS3MDL::probe(*this, hal.i2c_mgr->get_device(0, HAL_COMPASS_LIS3MDL_I2C_ADDR),
|
||||||
both_i2c_external, both_i2c_external?ROTATION_YAW_90:ROTATION_NONE),
|
both_i2c_external, both_i2c_external?ROTATION_YAW_90:ROTATION_NONE),
|
||||||
AP_Compass_LIS3MDL::name, both_i2c_external);
|
AP_Compass_LIS3MDL::name, both_i2c_external);
|
||||||
|
|
||||||
|
ADD_BACKEND(DRIVER_LIS3MDL, AP_Compass_LIS3MDL::probe(*this, hal.i2c_mgr->get_device(1, HAL_COMPASS_LIS3MDL_I2C_ADDR2),
|
||||||
|
true, ROTATION_YAW_90),
|
||||||
|
AP_Compass_LIS3MDL::name, true);
|
||||||
|
ADD_BACKEND(DRIVER_LIS3MDL, AP_Compass_LIS3MDL::probe(*this, hal.i2c_mgr->get_device(0, HAL_COMPASS_LIS3MDL_I2C_ADDR2),
|
||||||
|
both_i2c_external, both_i2c_external?ROTATION_YAW_90:ROTATION_NONE),
|
||||||
|
AP_Compass_LIS3MDL::name, both_i2c_external);
|
||||||
|
|
||||||
// AK09916. This can be found twice, due to the ICM20948 i2c bus pass-thru, so we need to be careful to avoid that
|
// AK09916. This can be found twice, due to the ICM20948 i2c bus pass-thru, so we need to be careful to avoid that
|
||||||
if (!_have_driver(AP_HAL::Device::BUS_TYPE_I2C, 1, HAL_COMPASS_AK09916_I2C_ADDR, AP_Compass_Backend::DEVTYPE_ICM20948)) {
|
if (!_have_driver(AP_HAL::Device::BUS_TYPE_I2C, 1, HAL_COMPASS_AK09916_I2C_ADDR, AP_Compass_Backend::DEVTYPE_ICM20948)) {
|
||||||
|
@ -23,10 +23,13 @@
|
|||||||
#include "AP_Compass_Backend.h"
|
#include "AP_Compass_Backend.h"
|
||||||
|
|
||||||
#ifndef HAL_COMPASS_LIS3MDL_I2C_ADDR
|
#ifndef HAL_COMPASS_LIS3MDL_I2C_ADDR
|
||||||
// this can also be on 0x1e
|
|
||||||
# define HAL_COMPASS_LIS3MDL_I2C_ADDR 0x1c
|
# define HAL_COMPASS_LIS3MDL_I2C_ADDR 0x1c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAL_COMPASS_LIS3MDL_I2C_ADDR2
|
||||||
|
# define HAL_COMPASS_LIS3MDL_I2C_ADDR2 0x1e
|
||||||
|
#endif
|
||||||
|
|
||||||
class AP_Compass_LIS3MDL : public AP_Compass_Backend
|
class AP_Compass_LIS3MDL : public AP_Compass_Backend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user