commander: add wind or flight time limit exceeded mode requirement

This prevents switching into any of these modes once the condition is set.
This commit is contained in:
Beat Küng
2023-02-01 08:48:09 +01:00
committed by Silvan Fuhrer
parent a8628c9d9c
commit b1709743f7
5 changed files with 14 additions and 2 deletions
@@ -147,6 +147,12 @@ void ModeChecks::checkAndReport(const Context &context, Report &reporter)
// Here we expect there is already an event reported for the failing check (this is for external modes)
reporter.clearCanRunBits((NavModes)reporter.failsafeFlags().mode_req_other);
}
if ((reporter.failsafeFlags().flight_time_limit_exceeded || reporter.failsafeFlags().wind_limit_exceeded)
&& reporter.failsafeFlags().mode_req_wind_and_flight_time_compliance != 0) {
// Already reported
reporter.clearCanRunBits((NavModes)reporter.failsafeFlags().mode_req_wind_and_flight_time_compliance);
}
}
void ModeChecks::checkArmingRequirement(const Context &context, Report &reporter)