mirror of https://github.com/ArduPilot/ardupilot
AP_Compass: add and use AP_COMPASS_MMC5XX3_ENABLED
This commit is contained in:
parent
47c48775ed
commit
1889d3dea5
|
@ -468,7 +468,9 @@ private:
|
||||||
#if AP_COMPASS_EXTERNALAHRS_ENABLED
|
#if AP_COMPASS_EXTERNALAHRS_ENABLED
|
||||||
DRIVER_EXTERNALAHRS =18,
|
DRIVER_EXTERNALAHRS =18,
|
||||||
#endif
|
#endif
|
||||||
|
#if AP_COMPASS_MMC5XX3_ENABLED
|
||||||
DRIVER_MMC5XX3 =19,
|
DRIVER_MMC5XX3 =19,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
bool _driver_enabled(enum DriverType driver_type);
|
bool _driver_enabled(enum DriverType driver_type);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#include "AP_Compass_MMC5xx3.h"
|
#include "AP_Compass_MMC5xx3.h"
|
||||||
|
|
||||||
|
#if AP_COMPASS_MMC5XX3_ENABLED
|
||||||
|
|
||||||
#include <AP_HAL/AP_HAL.h>
|
#include <AP_HAL/AP_HAL.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -305,3 +307,6 @@ void AP_Compass_MMC5XX3::read()
|
||||||
{
|
{
|
||||||
drain_accumulated_samples(compass_instance);
|
drain_accumulated_samples(compass_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // AP_COMPASS_MMC5XX3_ENABLED
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "AP_Compass_config.h"
|
||||||
|
|
||||||
|
#if AP_COMPASS_MMC5XX3_ENABLED
|
||||||
|
|
||||||
#include <AP_Common/AP_Common.h>
|
#include <AP_Common/AP_Common.h>
|
||||||
#include <AP_HAL/AP_HAL.h>
|
#include <AP_HAL/AP_HAL.h>
|
||||||
#include <AP_HAL/I2CDevice.h>
|
#include <AP_HAL/I2CDevice.h>
|
||||||
|
@ -72,3 +76,5 @@ private:
|
||||||
|
|
||||||
enum Rotation rotation;
|
enum Rotation rotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // AP_COMPASS_MMC5XX3_ENABLED
|
||||||
|
|
|
@ -91,6 +91,10 @@
|
||||||
#define AP_COMPASS_MMC3416_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
|
#define AP_COMPASS_MMC3416_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AP_COMPASS_MMC5XX3_ENABLED
|
||||||
|
#define AP_COMPASS_MMC5XX3_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef AP_COMPASS_QMC5883L_ENABLED
|
#ifndef AP_COMPASS_QMC5883L_ENABLED
|
||||||
#define AP_COMPASS_QMC5883L_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
|
#define AP_COMPASS_QMC5883L_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue