AP_LandingGear: make and use AP_LANDINGGEAR_ENABLED

This commit is contained in:
Peter Barker 2022-10-01 20:21:38 +10:00 committed by Andrew Tridgell
parent d60db821cf
commit e10593ee69
3 changed files with 25 additions and 0 deletions

View File

@ -1,4 +1,7 @@
#include "AP_LandingGear.h"
#if AP_LANDINGGEAR_ENABLED
#include <AP_Relay/AP_Relay.h>
#include <AP_Math/AP_Math.h>
#include <SRV_Channel/SRV_Channel.h>
@ -10,6 +13,10 @@
#include <SITL/SITL.h>
#endif
#if defined(APM_BUILD_TYPE)
// - this is just here to encourage the build system to supply the "legacy build defines". The actual dependecy is in the AP_LandingGear.h and AP_LandingGear_config.h headers
#endif
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_LandingGear::var_info[] = {
@ -331,3 +338,5 @@ void AP_LandingGear::deploy_for_landing()
deploy();
}
}
#endif

View File

@ -2,6 +2,10 @@
/// @brief Landing gear control library
#pragma once
#include "AP_LandingGear_config.h"
#if AP_LANDINGGEAR_ENABLED
#include <AP_Param/AP_Param.h>
#include <AP_Common/AP_Common.h>
@ -123,3 +127,5 @@ private:
static AP_LandingGear *_singleton;
};
#endif // AP_LANDINGGEAR_ENABLED

View File

@ -0,0 +1,10 @@
#pragma once
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_HAL/AP_HAL_Boards.h>
// historical compatability; only Copters get it - and Plane on
// non-minimized boards.
#ifndef AP_LANDINGGEAR_ENABLED
#define AP_LANDINGGEAR_ENABLED (APM_BUILD_COPTER_OR_HELI || (!HAL_MINIMIZE_FEATURES && APM_BUILD_TYPE(APM_BUILD_ArduPlane)))
#endif