AP_Arming: check CardInserted in AP_Arming

This commit is contained in:
Peter Barker 2016-11-06 09:05:36 +11:00 committed by Tom Pittenger
parent 98b5ab4656
commit 5776b3fddb
2 changed files with 8 additions and 5 deletions

View File

@ -82,7 +82,6 @@ AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &comp
_battery(battery),
home_is_set(home_set),
armed(false),
logging_available(false),
arming_method(NONE)
{
AP_Param::setup_object_defaults(this, var_info);
@ -144,9 +143,15 @@ bool AP_Arming::logging_checks(bool report)
{
if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING)) {
if (!logging_available) {
if (DataFlash_Class::instance()->logging_failed()) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Logging not available");
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Logging failed");
return false;
}
}
if (!DataFlash_Class::instance()->CardInserted()) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: No SD card");
}
return false;
}

View File

@ -59,8 +59,6 @@ public:
*/
virtual bool pre_arm_checks(bool report);
void set_logging_available(bool set) { logging_available = set; }
static const struct AP_Param::GroupInfo var_info[];
protected: