AP_LandingGear: allow compilation with HAL_LOGGING_ENABLED false

This commit is contained in:
Peter Barker 2023-07-14 10:58:06 +10:00 committed by Andrew Tridgell
parent 14beb2f191
commit 97c8d149f7
2 changed files with 9 additions and 2 deletions

View File

@ -174,7 +174,7 @@ void AP_LandingGear::deploy()
// set deployed flag
_deployed = true;
_have_changed = true;
AP::logger().Write_Event(LogEvent::LANDING_GEAR_DEPLOYED);
LOGGER_WRITE_EVENT(LogEvent::LANDING_GEAR_DEPLOYED);
}
/// retract - retract landing gear
@ -190,7 +190,7 @@ void AP_LandingGear::retract()
// reset deployed flag
_deployed = false;
_have_changed = true;
AP::logger().Write_Event(LogEvent::LANDING_GEAR_RETRACTED);
LOGGER_WRITE_EVENT(LogEvent::LANDING_GEAR_RETRACTED);
// send message only if output has been configured
if (SRV_Channels::function_assigned(SRV_Channel::k_landing_gear_control)) {
@ -303,6 +303,7 @@ void AP_LandingGear::update(float height_above_ground_m)
_last_height_above_ground = alt_m;
}
#if HAL_LOGGING_ENABLED
// log weight on wheels state
void AP_LandingGear::log_wow_state(LG_WOW_State state)
{
@ -310,6 +311,7 @@ void AP_LandingGear::log_wow_state(LG_WOW_State state)
AP_HAL::micros64(),
(int8_t)gear_state_current, (int8_t)state);
}
#endif
bool AP_LandingGear::check_before_land(void)
{

View File

@ -8,6 +8,7 @@
#include <AP_Param/AP_Param.h>
#include <AP_Common/AP_Common.h>
#include <AP_Logger/AP_Logger_config.h>
/// @class AP_LandingGear
/// @brief Class managing the control of landing gear
@ -122,8 +123,12 @@ private:
/// deploy - deploy the landing gear
void deploy();
#if HAL_LOGGING_ENABLED
// log weight on wheels state
void log_wow_state(LG_WOW_State state);
#else
void log_wow_state(LG_WOW_State state) {}
#endif
static AP_LandingGear *_singleton;
};