From 3fabec4158e23691d3f1f06de3dc020b5d002312 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Mon, 11 Mar 2024 12:40:57 +0000 Subject: [PATCH] AP_Arming: ensure fence enablement on arming is inverted on disarming --- libraries/AP_Arming/AP_Arming.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 83e7cac174..2be3a1011f 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -1840,9 +1840,7 @@ bool AP_Arming::disarm(const AP_Arming::Method method, bool do_disarm_checks) #if AP_FENCE_ENABLED AC_Fence *fence = AP::fence(); if (fence != nullptr) { - if(fence->auto_enabled() == AC_Fence::AutoEnable::ONLY_WHEN_ARMED) { - fence->enable_configured(false); - } + fence->auto_disable_fence_on_disarming(); } #endif #if defined(HAL_ARM_GPIO_PIN)