Copter: allow fence to be disabled while AFS is enabled

This commit is contained in:
Peter Barker 2018-02-24 14:23:36 +11:00 committed by Randy Mackay
parent bb9af3b79d
commit e66034f183
1 changed files with 6 additions and 1 deletions

View File

@ -79,6 +79,11 @@ void Copter::failsafe_check()
void Copter::afs_fs_check(void)
{
// perform AFS failsafe checks
g2.afs.check(failsafe.last_heartbeat_ms, fence.get_breaches() != 0, last_radio_update_ms);
#if AC_FENCE
const bool fence_breached = fence.get_breaches() != 0;
#else
const bool fence_breached = false;
#endif
g2.afs.check(failsafe.last_heartbeat_ms, fence_breached, last_radio_update_ms);
}
#endif