mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
Blimp: use check_enabked hepler to always check if all bit is set
This commit is contained in:
parent
e35b52c0be
commit
31ba715616
@ -45,7 +45,7 @@ bool AP_Arming_Blimp::barometer_checks(bool display_failure)
|
|||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
// check Baro
|
// check Baro
|
||||||
if ((checks_to_perform == ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_BARO)) {
|
if (check_enabled(ARMING_CHECK_BARO)) {
|
||||||
// Check baro & inav alt are within 1m if EKF is operating in an absolute position mode.
|
// Check baro & inav alt are within 1m if EKF is operating in an absolute position mode.
|
||||||
// Do not check if intending to operate in a ground relative height mode as EKF will output a ground relative height
|
// Do not check if intending to operate in a ground relative height mode as EKF will output a ground relative height
|
||||||
// that may differ from the baro height due to baro drift.
|
// that may differ from the baro height due to baro drift.
|
||||||
@ -65,7 +65,7 @@ bool AP_Arming_Blimp::ins_checks(bool display_failure)
|
|||||||
{
|
{
|
||||||
bool ret = AP_Arming::ins_checks(display_failure);
|
bool ret = AP_Arming::ins_checks(display_failure);
|
||||||
|
|
||||||
if ((checks_to_perform == ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_INS)) {
|
if (check_enabled(ARMING_CHECK_INS)) {
|
||||||
|
|
||||||
// get ekf attitude (if bad, it's usually the gyro biases)
|
// get ekf attitude (if bad, it's usually the gyro biases)
|
||||||
if (!pre_arm_ekf_attitude_check()) {
|
if (!pre_arm_ekf_attitude_check()) {
|
||||||
@ -84,7 +84,7 @@ bool AP_Arming_Blimp::board_voltage_checks(bool display_failure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check battery voltage
|
// check battery voltage
|
||||||
if ((checks_to_perform == ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_VOLTAGE)) {
|
if (check_enabled(ARMING_CHECK_VOLTAGE)) {
|
||||||
if (blimp.battery.has_failsafed()) {
|
if (blimp.battery.has_failsafed()) {
|
||||||
check_failed(ARMING_CHECK_VOLTAGE, display_failure, "Battery failsafe");
|
check_failed(ARMING_CHECK_VOLTAGE, display_failure, "Battery failsafe");
|
||||||
return false;
|
return false;
|
||||||
@ -102,7 +102,7 @@ bool AP_Arming_Blimp::board_voltage_checks(bool display_failure)
|
|||||||
bool AP_Arming_Blimp::parameter_checks(bool display_failure)
|
bool AP_Arming_Blimp::parameter_checks(bool display_failure)
|
||||||
{
|
{
|
||||||
// check various parameter values
|
// check various parameter values
|
||||||
if ((checks_to_perform == ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_PARAMETERS)) {
|
if (check_enabled(ARMING_CHECK_PARAMETERS)) {
|
||||||
|
|
||||||
// failsafe parameter checks
|
// failsafe parameter checks
|
||||||
if (blimp.g.failsafe_throttle) {
|
if (blimp.g.failsafe_throttle) {
|
||||||
@ -159,7 +159,7 @@ bool AP_Arming_Blimp::gps_checks(bool display_failure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return true immediately if gps check is disabled
|
// return true immediately if gps check is disabled
|
||||||
if (!(checks_to_perform == ARMING_CHECK_ALL || checks_to_perform & ARMING_CHECK_GPS)) {
|
if (!check_enabled(ARMING_CHECK_GPS)) {
|
||||||
AP_Notify::flags.pre_arm_gps_check = true;
|
AP_Notify::flags.pre_arm_gps_check = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user