mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 05:58:30 -04:00
Copter: battery arming checks call parent AP_Arming
This commit is contained in:
parent
d8ba0b2914
commit
af43666b6a
@ -200,12 +200,30 @@ bool AP_Arming_Copter::board_voltage_checks(bool display_failure)
|
||||
|
||||
// check battery voltage
|
||||
if ((checks_to_perform == ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_VOLTAGE)) {
|
||||
if (copter.failsafe.battery || (!copter.ap.usb_connected && copter.battery.exhausted(g.fs_batt_voltage, g.fs_batt_mah))) {
|
||||
if (copter.failsafe.battery) {
|
||||
if (display_failure) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL,"PreArm: Battery failsafe");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// all following checks are skipped if USB is connected
|
||||
if (copter.ap.usb_connected) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if battery is exhausted
|
||||
if (copter.battery.exhausted(g.fs_batt_voltage, g.fs_batt_mah)) {
|
||||
if (display_failure) {
|
||||
gcs_send_text(MAV_SEVERITY_CRITICAL,"PreArm: Check Battery");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// call parent battery checks
|
||||
if (!AP_Arming::battery_checks(display_failure)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user