From 97c8d149f7b185a3fea7782a948e4d6da4a3c070 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 14 Jul 2023 10:58:06 +1000 Subject: [PATCH] AP_LandingGear: allow compilation with HAL_LOGGING_ENABLED false --- libraries/AP_LandingGear/AP_LandingGear.cpp | 6 ++++-- libraries/AP_LandingGear/AP_LandingGear.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/AP_LandingGear/AP_LandingGear.cpp b/libraries/AP_LandingGear/AP_LandingGear.cpp index 8f77d5e3df..7ac8971994 100644 --- a/libraries/AP_LandingGear/AP_LandingGear.cpp +++ b/libraries/AP_LandingGear/AP_LandingGear.cpp @@ -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) { diff --git a/libraries/AP_LandingGear/AP_LandingGear.h b/libraries/AP_LandingGear/AP_LandingGear.h index 6cafc77d5a..cfa0eebaae 100644 --- a/libraries/AP_LandingGear/AP_LandingGear.h +++ b/libraries/AP_LandingGear/AP_LandingGear.h @@ -8,6 +8,7 @@ #include #include +#include /// @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; };