AP_Arming: ensure fence enablement on arming is inverted on disarming

This commit is contained in:
Andy Piper 2024-03-11 12:40:57 +00:00 committed by Peter Barker
parent 174d5f07bb
commit 3fabec4158

View File

@ -1840,9 +1840,7 @@ bool AP_Arming::disarm(const AP_Arming::Method method, bool do_disarm_checks)
#if AP_FENCE_ENABLED #if AP_FENCE_ENABLED
AC_Fence *fence = AP::fence(); AC_Fence *fence = AP::fence();
if (fence != nullptr) { if (fence != nullptr) {
if(fence->auto_enabled() == AC_Fence::AutoEnable::ONLY_WHEN_ARMED) { fence->auto_disable_fence_on_disarming();
fence->enable_configured(false);
}
} }
#endif #endif
#if defined(HAL_ARM_GPIO_PIN) #if defined(HAL_ARM_GPIO_PIN)