From d066588c918c203a9363e7bc148dede35c81aff8 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 10 Sep 2022 22:03:02 +0100 Subject: [PATCH] AC_Fence: always clear breaches --- libraries/AC_Fence/AC_Fence.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AC_Fence/AC_Fence.cpp b/libraries/AC_Fence/AC_Fence.cpp index 3ec8269306..e94658ee26 100644 --- a/libraries/AC_Fence/AC_Fence.cpp +++ b/libraries/AC_Fence/AC_Fence.cpp @@ -543,14 +543,14 @@ uint8_t AC_Fence::check() { uint8_t ret = 0; + // clear any breach from a non-enabled fence + clear_breach(~_enabled_fences); + // return immediately if disabled if ((!_enabled && !_auto_enabled) || !_enabled_fences) { return 0; } - // clear any breach from a non-enabled fence - clear_breach(~_enabled_fences); - // check if pilot is attempting to recover manually if (_manual_recovery_start_ms != 0) { // we ignore any fence breaches during the manual recovery period which is about 10 seconds