Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AC_Fence: add prearm check if fences enabled but none selected #17458

Merged
merged 1 commit into from May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/AC_Fence/AC_Fence.cpp
Expand Up @@ -282,6 +282,12 @@ bool AC_Fence::pre_arm_check(const char* &fail_msg) const
{
fail_msg = nullptr;

// if fences are enabled but none selected fail pre-arm check
if (enabled() && !present()) {
fail_msg = "Fences enabled, but none selected";
return false;
}

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