mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-18 07:40:36 +08:00
commander: move ownership of vehicle_status_flags_s to HealthAndArmingChecks
This commit is contained in:
@@ -172,6 +172,7 @@ void Report::reset()
|
||||
_results[_current_result].reset();
|
||||
_next_buffer_idx = 0;
|
||||
_buffer_overflowed = false;
|
||||
_results_changed = false;
|
||||
}
|
||||
|
||||
void Report::prepare(uint8_t vehicle_type)
|
||||
@@ -186,16 +187,18 @@ NavModes Report::getModeGroup(uint8_t nav_state) const
|
||||
return (NavModes)(1u << nav_state);
|
||||
}
|
||||
|
||||
void Report::finalize()
|
||||
bool Report::finalize()
|
||||
{
|
||||
_results[_current_result].arming_checks.valid = true;
|
||||
_already_reported = false;
|
||||
_results_changed = _results[0] != _results[1];
|
||||
return _results_changed;
|
||||
}
|
||||
|
||||
bool Report::report(bool is_armed, bool force)
|
||||
{
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
const bool has_difference = _had_unreported_difference || _results[0] != _results[1];
|
||||
const bool has_difference = _had_unreported_difference || _results_changed;
|
||||
|
||||
if (now - _last_report < _min_reporting_interval && !force) {
|
||||
if (has_difference) {
|
||||
|
||||
Reference in New Issue
Block a user