Browse Source

AP_Arming: check CardInserted in AP_Arming

master
Peter Barker 8 years ago committed by Tom Pittenger
parent
commit
5776b3fddb
  1. 11
      libraries/AP_Arming/AP_Arming.cpp
  2. 2
      libraries/AP_Arming/AP_Arming.h

11
libraries/AP_Arming/AP_Arming.cpp

@ -82,7 +82,6 @@ AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &comp
_battery(battery), _battery(battery),
home_is_set(home_set), home_is_set(home_set),
armed(false), armed(false),
logging_available(false),
arming_method(NONE) arming_method(NONE)
{ {
AP_Param::setup_object_defaults(this, var_info); 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) || if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING)) { (checks_to_perform & ARMING_CHECK_LOGGING)) {
if (!logging_available) { if (DataFlash_Class::instance()->logging_failed()) {
if (report) { 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; return false;
} }

2
libraries/AP_Arming/AP_Arming.h

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

Loading…
Cancel
Save