AP_Arming: check actual battery instances then max possible instances

This commit is contained in:
Tom Pittenger 2016-06-02 15:00:34 -07:00
parent 3ed2fafefa
commit 8939c5308f

View File

@ -368,7 +368,7 @@ bool AP_Arming::battery_checks(bool report)
return false;
}
for (int i = 0; i < AP_BATT_MONITOR_MAX_INSTANCES; i++) {
for (int i = 0; i < _battery.num_instances(); i++) {
if ((_min_voltage[i] > 0.0f) && (_battery.voltage(i) < _min_voltage[i])) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Battery %d voltage %.1f below minimum %.1f",