From e12b470cac302ac49cd1c240ef0f8f85870a4147 Mon Sep 17 00:00:00 2001 From: Philipp Oettershagen Date: Wed, 6 Jun 2018 13:00:49 +0200 Subject: [PATCH] Subsystem_info status flags & checks: Small fixes according to @bkueng's review --- src/modules/commander/PreflightCheck.cpp | 4 ++-- src/modules/sensors/voted_sensors_update.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/PreflightCheck.cpp b/src/modules/commander/PreflightCheck.cpp index 11bbacfdcb..57ce023dfd 100644 --- a/src/modules/commander/PreflightCheck.cpp +++ b/src/modules/commander/PreflightCheck.cpp @@ -248,9 +248,9 @@ static bool magConsistencyCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s if (sensors.mag_inconsistency_ga > test_limit) { if (report_status) { mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: MAG SENSORS INCONSISTENT"); + set_health_flags_healthy(subsystem_info_s::SUBSYSTEM_TYPE_MAG, false, status); + set_health_flags_healthy(subsystem_info_s::SUBSYSTEM_TYPE_MAG2, false, status); } - set_health_flags_healthy(subsystem_info_s::SUBSYSTEM_TYPE_MAG, false, status); - set_health_flags_healthy(subsystem_info_s::SUBSYSTEM_TYPE_MAG2, false, status); return false; } diff --git a/src/modules/sensors/voted_sensors_update.cpp b/src/modules/sensors/voted_sensors_update.cpp index e97ce51ca1..eb8c3e7e87 100644 --- a/src/modules/sensors/voted_sensors_update.cpp +++ b/src/modules/sensors/voted_sensors_update.cpp @@ -945,6 +945,7 @@ bool VotedSensorsUpdate::check_failover(SensorData &sensor, const char *sensor_n if (type == subsystem_info_s::SUBSYSTEM_TYPE_MAG) { _info.subsystem_type = subsystem_info_s::SUBSYSTEM_TYPE_MAG2; } } + _info.timestamp = hrt_absolute_time(); _info.present = true; _info.enabled = true; _info.ok = false;