AP_Arming: use HAL_HAVE_BOARD_VOLTAGE rather than magic-0

This commit is contained in:
Peter Barker 2017-07-15 17:38:37 +10:00 committed by Francisco Ferreira
parent a7bc111485
commit b8ddf8a289

View File

@ -454,17 +454,17 @@ bool AP_Arming::manual_transmitter_checks(bool report)
bool AP_Arming::board_voltage_checks(bool report)
{
#if HAL_HAVE_BOARD_VOLTAGE
// check board voltage
if ((checks_to_perform & ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_VOLTAGE)) {
if(!is_zero(hal.analogin->board_voltage()) &&
((hal.analogin->board_voltage() < AP_ARMING_BOARD_VOLTAGE_MIN) || (hal.analogin->board_voltage() > AP_ARMING_BOARD_VOLTAGE_MAX))) {
if(((hal.analogin->board_voltage() < AP_ARMING_BOARD_VOLTAGE_MIN) || (hal.analogin->board_voltage() > AP_ARMING_BOARD_VOLTAGE_MAX))) {
if (report) {
gcs().send_text(MAV_SEVERITY_CRITICAL,"PreArm: Check board voltage");
}
return false;
}
}
#endif
return true;
}