From c434ef1507999069db24a548e8243aded498f966 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 13 Jan 2026 23:14:33 -0900 Subject: [PATCH] fix build and rename _param_escs_checks_required --- .../commander/HealthAndArmingChecks/checks/escCheck.cpp | 6 +++--- .../commander/HealthAndArmingChecks/checks/escCheck.hpp | 2 +- src/modules/mavlink/mavlink_receiver.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/commander/HealthAndArmingChecks/checks/escCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/escCheck.cpp index 61657b9803..3c28ae4370 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/escCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/escCheck.cpp @@ -82,7 +82,7 @@ void EscChecks::checkAndReport(const Context &context, Report &reporter) checkEscStatus(context, reporter, esc_status); reporter.setIsPresent(health_component_t::motors_escs); - } else if (_param_escs_checks_required.get() + } else if (_param_com_arm_chk_escs.get() && now - _start_time > 5_s) { // Wait a bit after startup to allow esc's to init /* EVENT @@ -102,7 +102,7 @@ void EscChecks::checkAndReport(const Context &context, Report &reporter) void EscChecks::checkEscStatus(const Context &context, Report &reporter, const esc_status_s &esc_status) { - const NavModes required_modes = _param_escs_checks_required.get() ? NavModes::All : NavModes::None; + const NavModes required_modes = _param_com_arm_chk_escs.get() ? NavModes::All : NavModes::None; if (esc_status.esc_count > 0) { // Check if one or more the ESCs are offline @@ -118,7 +118,7 @@ void EscChecks::checkEscStatus(const Context &context, Report &reporter, const e uint8_t actuator_function = esc_status.esc[i].actuator_function; bool is_motor = math::isInRange(actuator_function, actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1, - actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1 + actuator_motors_s::NUM_CONTROLS - 1); + uint8_t(actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1 + actuator_motors_s::NUM_CONTROLS - 1)); bool is_online = esc_status.esc_online_flags & (1 << i); if (is_motor && !is_online) { diff --git a/src/modules/commander/HealthAndArmingChecks/checks/escCheck.hpp b/src/modules/commander/HealthAndArmingChecks/checks/escCheck.hpp index 7e32563e46..a96c147234 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/escCheck.hpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/escCheck.hpp @@ -54,6 +54,6 @@ private: const hrt_abstime _start_time{hrt_absolute_time()}; DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase, - (ParamBool) _param_escs_checks_required + (ParamBool) _param_com_arm_chk_escs ) }; diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 116127349e..ad48f9c8a4 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -607,8 +607,8 @@ void MavlinkReceiver::handle_message_command_both(mavlink_message_t *msg, const if (message_id == MAVLINK_MSG_ID_ESC_EEPROM) { PX4_INFO("publishing MAV_CMD_REQUEST_MESSAGE for MAVLINK_MSG_ID_ESC_EEPROM"); _cmd_pub.publish(vehicle_command); -else - if (1) +#else + if (1) { // no-op #endif } else if (message_id == MAVLINK_MSG_ID_MESSAGE_INTERVAL) {