From 86e495f415d4ddcf7046e7c2bece3d68a1b2c970 Mon Sep 17 00:00:00 2001 From: murata Date: Sat, 3 Dec 2016 21:30:46 +0900 Subject: [PATCH] AP_Arming: Do not set check results each time. --- libraries/AP_Arming/AP_Arming.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index d2cca85f1a..7bbcc451e2 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -445,24 +445,21 @@ bool AP_Arming::board_voltage_checks(bool report) bool AP_Arming::pre_arm_checks(bool report) { - bool ret = true; if (armed || require == NONE) { // if we are already armed or don't need any arming checks // then skip the checks return true; } - ret &= hardware_safety_check(report); - ret &= barometer_checks(report); - ret &= ins_checks(report); - ret &= compass_checks(report); - ret &= gps_checks(report); - ret &= battery_checks(report); - ret &= logging_checks(report); - ret &= manual_transmitter_checks(report); - ret &= board_voltage_checks(report); - - return ret; + return hardware_safety_check(report) + & barometer_checks(report) + & ins_checks(report) + & compass_checks(report) + & gps_checks(report) + & battery_checks(report) + & logging_checks(report) + & manual_transmitter_checks(report) + & board_voltage_checks(report); } bool AP_Arming::arm_checks(uint8_t method)