diff --git a/ArduPlane/AP_Arming.cpp b/ArduPlane/AP_Arming.cpp index 5e8923b694..1bf5984507 100644 --- a/ArduPlane/AP_Arming.cpp +++ b/ArduPlane/AP_Arming.cpp @@ -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) 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); +} diff --git a/ArduPlane/AP_Arming.h b/ArduPlane/AP_Arming.h index 480ab96110..b00ff8b236 100644 --- a/ArduPlane/AP_Arming.h +++ b/ArduPlane/AP_Arming.h @@ -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; };