geofence: re-breach if user changes mode outside the fence

if the user changes mode while outside the fence, and fencing is still
enabled, then declare a new breach
This commit is contained in:
Andrew Tridgell 2011-12-28 17:28:35 +11:00
parent f8e1d88815
commit c91827ee09
1 changed files with 1 additions and 2 deletions

View File

@ -235,13 +235,12 @@ static void geofence_check(bool altitude_check_only)
}
// we are outside the fence
if (geofence_state->fence_triggered) {
if (geofence_state->fence_triggered && control_mode == GUIDED) {
// we have already triggered, don't trigger again until the
// user disables/re-enables using the fence channel switch
return;
}
// we are outside, and have not previously triggered.
geofence_state->fence_triggered = true;
geofence_state->breach_count++;