Copter: add pre-arm board voltage check

Copter will not arm unless board voltage is over 4.5V
This commit is contained in:
Randy Mackay 2013-05-28 21:50:31 +09:00
parent eba7d6da9a
commit c3d21a457f
2 changed files with 12 additions and 0 deletions

View File

@ -382,6 +382,10 @@
# define HIGH_DISCHARGE 1760
#endif
#ifndef BOARD_VOLTAGE_MIN
# define BOARD_VOLTAGE_MIN 4500 // min board voltage in milli volts for pre-arm checks
#endif
// Battery failsafe
#ifndef FS_BATTERY
# define FS_BATTERY DISABLED

View File

@ -264,6 +264,14 @@ static void pre_arm_checks(bool display_failure)
}
#endif
// check board voltage
if(board_voltage() < BOARD_VOLTAGE_MIN) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Low Board Voltage"));
}
return;
}
// if we've gotten this far then pre arm checks have completed
ap.pre_arm_check = true;
}