check: Changing the order of messages and events

This commit is contained in:
muramura 2024-01-27 13:30:27 +09:00 committed by Daniel Agar
parent 3c444c2f2a
commit 23ae769e46
1 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,11 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
if (_param_com_flt_time_max.get() > FLT_EPSILON && context.status().takeoff_time != 0 &&
(hrt_absolute_time() - context.status().takeoff_time) > (1_s * _param_com_flt_time_max.get())) {
reporter.failsafeFlags().flight_time_limit_exceeded = true;
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Maximum flight time reached\t");
}
/* EVENT
* @description
* <profile name="dev">
@ -48,10 +53,6 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
events::ID("check_flight_time_limit"),
events::Log::Error, "Maximum flight time reached");
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Maximum flight time reached\t");
}
} else {
reporter.failsafeFlags().flight_time_limit_exceeded = false;
}