Plane: add arming check for logging actually started

This commit is contained in:
Peter Barker 2016-11-06 10:23:32 +11:00 committed by Tom Pittenger
parent fff2068a5a
commit f712dd5d7e
2 changed files with 14 additions and 0 deletions

View File

@ -122,6 +122,7 @@ public:
AP_Param::setup_object_defaults(this, var_info);
}
bool pre_arm_checks(bool report);
bool arm(uint8_t method) override;
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];

View File

@ -18,8 +18,21 @@ const AP_Param::GroupInfo AP_Arming_Plane::var_info[] = {
};
bool AP_Arming_Plane::arm(uint8_t method)
{
// start logging here so we can check success or failure in
// arm_checks
if (plane.g.log_bitmask != NONE &&
!plane.DataFlash.logging_started()) {
plane.start_logging();
}
return AP_Arming::arm(method);
}
/*
additional arming checks for plane
*/
bool AP_Arming_Plane::pre_arm_checks(bool report)
{