Skip to content

Commit

Permalink
AC_FENCE:Add AUTOENABLE deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg committed Jul 24, 2024
1 parent a371a3e commit 416e8c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libraries/AC_Fence/AC_Fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,16 @@ bool AC_Fence::pre_arm_check(char *failure_msg, const uint8_t failure_msg_len) c
hal.util->snprintf(failure_msg, failure_msg_len, "Fences enabled, but none selected");
return false;
}

// if AUTOENABLE = 1 or 2 warn now, but fail in a later release
static uint8_t i = 0 ;
i++;
if (i > 60) {
if (_auto_enabled == 1 or _auto_enabled == 2) {
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "FENCE_AUTOENABLE set to 1 or 2, will be deprecated next release, use 0 or 3");
i = 0;
}
}

// if not enabled or not fence set-up always return true
if ((!enabled() && !_auto_enabled) || !_configured_fences) {
Expand Down

0 comments on commit 416e8c1

Please sign in to comment.