Commander: baro check: only report failure of mandatory instances

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2021-03-21 21:06:49 +01:00 committed by Daniel Agar
parent 8acdb8ca3f
commit 381c97d3c6

View File

@ -150,7 +150,7 @@ bool PreFlightCheck::preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_statu
/* check all sensors, but fail only for mandatory ones */
for (unsigned i = 0; i < max_optional_baro_count; i++) {
const bool required = (i < max_mandatory_baro_count) && (sys_has_baro == 1);
bool report_fail = (report_failures && !baro_fail_reported);
bool report_fail = (required && report_failures && !baro_fail_reported);
int32_t device_id = -1;