PreflightCheck: do not check for primary mag & inconsistencies if system has no mag

This commit is contained in:
Beat Küng 2018-09-24 12:04:24 +02:00
parent 5a57e82072
commit 92bf761bf1
1 changed files with 13 additions and 11 deletions

View File

@ -717,19 +717,21 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status,
} }
} }
/* check if the primary device is present */ if (sys_has_mag == 1) {
if (!prime_found) { /* check if the primary device is present */
if (reportFailures && !failed) { if (!prime_found) {
mavlink_log_critical(mavlink_log_pub, "Primary compass not found"); if (reportFailures && !failed) {
mavlink_log_critical(mavlink_log_pub, "Primary compass not found");
}
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_MAG, false, true, false, status);
failed = true;
} }
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_MAG, false, true, false, status); /* mag consistency checks (need to be performed after the individual checks) */
failed = true; if (!magConsistencyCheck(mavlink_log_pub, status, (reportFailures && !failed))) {
} failed = true;
}
/* mag consistency checks (need to be performed after the individual checks) */
if (!magConsistencyCheck(mavlink_log_pub, status, (reportFailures && !failed))) {
failed = true;
} }
} }