From df3affc38c258ba6b6e5119e5d61b8923918759c Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 4 Mar 2022 16:38:15 +0000 Subject: [PATCH] AP_Frsky_Telem: fix complation without fence --- libraries/AP_Frsky_Telem/AP_Frsky_MAVliteMsgHandler.cpp | 4 ++++ libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libraries/AP_Frsky_Telem/AP_Frsky_MAVliteMsgHandler.cpp b/libraries/AP_Frsky_Telem/AP_Frsky_MAVliteMsgHandler.cpp index 4f9ecaf0e9..cd3f23c672 100644 --- a/libraries/AP_Frsky_Telem/AP_Frsky_MAVliteMsgHandler.cpp +++ b/libraries/AP_Frsky_Telem/AP_Frsky_MAVliteMsgHandler.cpp @@ -142,6 +142,7 @@ MAV_RESULT AP_Frsky_MAVliteMsgHandler::handle_command_preflight_calibration_baro MAV_RESULT AP_Frsky_MAVliteMsgHandler::handle_command_do_fence_enable(const mavlink_command_long_t &mav_command_long) { +#if AC_FENCE AC_Fence *fence = AP::fence(); if (fence == nullptr) { return MAV_RESULT_UNSUPPORTED; @@ -157,6 +158,9 @@ MAV_RESULT AP_Frsky_MAVliteMsgHandler::handle_command_do_fence_enable(const mavl default: return MAV_RESULT_FAILED; } +#else + return MAV_RESULT_UNSUPPORTED; +#endif // AC_FENCE } /* diff --git a/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp b/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp index 3f7457f295..f210734de1 100644 --- a/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp +++ b/libraries/AP_Frsky_Telem/AP_Frsky_SPort_Passthrough.cpp @@ -582,12 +582,14 @@ uint32_t AP_Frsky_SPort_Passthrough::calc_ap_status(void) ap_status |= (uint8_t)(AP_Notify::flags.ekf_bad)<enabled() && fence->present()) << AP_FENCE_PRESENT_OFFSET; ap_status |= (uint8_t)(fence->get_breaches()>0) << AP_FENCE_BREACH_OFFSET; } +#endif // signed throttle [-100,100] scaled down to [-63,63] on 7 bits, MSB for sign + 6 bits for 0-63 ap_status |= prep_number(gcs().get_hud_throttle()*0.63, 2, 0)<