diff --git a/ArduCopter/flight_mode.pde b/ArduCopter/flight_mode.pde index e12b4c9f0b492a4ab292e99e285ce9de35251acb..a87d1b714d1ec2da272116414ab78e9d2fc9f6a7 100644 --- a/ArduCopter/flight_mode.pde +++ b/ArduCopter/flight_mode.pde @@ -267,8 +267,10 @@ static bool manual_flight_mode(uint8_t mode) { return false; } -static bool mode_allows_arming(uint8_t mode) { - if (manual_flight_mode(mode) || mode == LOITER || mode == ALT_HOLD || mode == POSHOLD || mode == AUTOTUNE || mode == GUIDED) { +// mode_allows_arming - returns true if vehicle can be armed in the specified mode +// arming_from_gcs should be set to true if the arming request comes from the ground station +static bool mode_allows_arming(uint8_t mode, bool arming_from_gcs) { + if (manual_flight_mode(mode) || mode == LOITER || mode == ALT_HOLD || mode == POSHOLD || (arming_from_gcs && mode == GUIDED)) { return true; } return false; diff --git a/ArduCopter/motors.pde b/ArduCopter/motors.pde index c1f893a9fd9c46aaf816c1d4868ab72bebaf3784..22715897287094b2b310bfa81854373501b1cc47 100644 --- a/ArduCopter/motors.pde +++ b/ArduCopter/motors.pde @@ -528,10 +528,10 @@ static bool pre_arm_gps_checks(bool display_failure) // arm_checks - perform final checks before arming // always called just before arming. Return true if ok to arm -static bool arm_checks(bool display_failure, bool request_from_gcs) +static bool arm_checks(bool display_failure, bool arming_from_gcs) { // always check if the current mode allows arming - if (!mode_allows_arming(control_mode) || (!request_from_gcs && control_mode == GUIDED)) { + if (!mode_allows_arming(control_mode, arming_from_gcs)) { if (display_failure) { gcs_send_text_P(SEVERITY_HIGH,PSTR("Arm: Mode not armable")); }