Browse Source

Plane: bypass arming checks for armed watchdog reboot

master
Andrew Tridgell 6 years ago
parent
commit
ebbe01bd83
  1. 22
      ArduPlane/AP_Arming.cpp
  2. 5
      ArduPlane/AP_Arming.h

22
ArduPlane/AP_Arming.cpp

@ -19,6 +19,14 @@ const AP_Param::GroupInfo AP_Arming_Plane::var_info[] = { @@ -19,6 +19,14 @@ const AP_Param::GroupInfo AP_Arming_Plane::var_info[] = {
*/
bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
{
if (hal.util->was_watchdog_armed()) {
// on watchdog reset bypass arming checks to allow for
// in-flight arming if we were armed before the reset. This
// allows a reset on a BVLOS flight to return home if the
// operator can command arming over telemetry
return true;
}
// call parent class checks
bool ret = AP_Arming::pre_arm_checks(display_failure);
@ -117,3 +125,17 @@ bool AP_Arming_Plane::ins_checks(bool display_failure) @@ -117,3 +125,17 @@ bool AP_Arming_Plane::ins_checks(bool display_failure)
return true;
}
bool AP_Arming_Plane::arm_checks(AP_Arming::Method method)
{
if (hal.util->was_watchdog_armed()) {
// on watchdog reset bypass arming checks to allow for
// in-flight arming if we were armed before the reset. This
// allows a reset on a BVLOS flight to return home if the
// operator can command arming over telemetry
gcs().send_text(MAV_SEVERITY_WARNING, "watchdog: Bypassing arming checks");
return true;
}
// call parent class checks
return AP_Arming::arm_checks(method);
}

5
ArduPlane/AP_Arming.h

@ -18,12 +18,13 @@ public: @@ -18,12 +18,13 @@ public:
AP_Arming_Plane(const AP_Arming_Plane &other) = delete;
AP_Arming_Plane &operator=(const AP_Arming_Plane&) = delete;
bool pre_arm_checks(bool report);
bool pre_arm_checks(bool report) override;
bool arm_checks(AP_Arming::Method method) override;
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];
protected:
bool ins_checks(bool report);
bool ins_checks(bool report) override;
};

Loading…
Cancel
Save