AP_Arming: prepare log for arming and check it is ready

Also add comment that this should be the last check to be made
This commit is contained in:
Peter Barker 2017-06-30 22:31:08 +10:00 committed by Francisco Ferreira
parent 0769432e63
commit 954eda990a
1 changed files with 5 additions and 1 deletions

View File

@ -491,9 +491,13 @@ bool AP_Arming::pre_arm_checks(bool report)
bool AP_Arming::arm_checks(uint8_t method)
{
// note that this will prepare DataFlash to start logging
// so should be the last check to be done before arming
if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING)) {
if (!DataFlash_Class::instance()->logging_started()) {
DataFlash_Class *df = DataFlash_Class::instance();
df->PrepForArming();
if (!df->logging_started()) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "Arm: Logging not started");
return false;
}