clang-tidy: enable readability-simplify-boolean-expr and fix

This commit is contained in:
Daniel Agar
2019-10-27 19:19:07 -04:00
parent 279df3b1b8
commit 967446af4c
15 changed files with 53 additions and 93 deletions
+2 -4
View File
@@ -1983,16 +1983,14 @@ Commander::run()
/* handle the case where RC signal was regained */
if (!status_flags.rc_signal_found_once) {
status_flags.rc_signal_found_once = true;
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_RCRECEIVER, true, true, true
&& status_flags.rc_calibration_valid, status);
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_RCRECEIVER, true, true, status_flags.rc_calibration_valid, status);
status_changed = true;
} else {
if (status.rc_signal_lost) {
mavlink_log_info(&mavlink_log_pub, "Manual control regained after %llums",
hrt_elapsed_time(&rc_signal_lost_timestamp) / 1000);
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_RCRECEIVER, true, true, true
&& status_flags.rc_calibration_valid, status);
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_RCRECEIVER, true, true, status_flags.rc_calibration_valid, status);
status_changed = true;
}
}
+9 -9
View File
@@ -868,7 +868,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, veh
/* ---- BARO ---- */
if (checkSensors) {
bool prime_found = false;
//bool prime_found = false;
int32_t prime_id = -1;
param_get(param_find("CAL_BARO_PRIME"), &prime_id);
@@ -887,7 +887,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, veh
if (baroCheck(mavlink_log_pub, status, i, !required, device_id, report_fail)) {
if ((prime_id > 0) && (device_id == prime_id)) {
prime_found = true;
//prime_found = true;
}
} else {
@@ -900,14 +900,14 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, veh
// TODO there is no logic in place to calibrate the primary baro yet
// // check if the primary device is present
if (!prime_found && false) {
if (reportFailures && !failed) {
mavlink_log_critical(mavlink_log_pub, "Primary barometer not operational");
}
// if (false) {
// if (reportFailures && !failed) {
// mavlink_log_critical(mavlink_log_pub, "Primary barometer not operational");
// }
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_ABSPRESSURE, false, true, false, status);
failed = true;
}
// set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_ABSPRESSURE, false, true, false, status);
// failed = true;
// }
}
/* ---- IMU CONSISTENCY ---- */