diff --git a/ArduCopter/flight_mode.pde b/ArduCopter/flight_mode.pde index e12b4c9f0b..a87d1b714d 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 cd02917689..e3b6dd27c0 100644 --- a/ArduCopter/motors.pde +++ b/ArduCopter/motors.pde @@ -504,10 +504,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")); }