|
|
|
@ -256,13 +256,6 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason)
@@ -256,13 +256,6 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason)
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if MODE_ZIGZAG_ENABLED == ENABLED && SPRAYER_ENABLED == ENABLED |
|
|
|
|
// The pump will stop if the flight mode is changed from ZigZag to other
|
|
|
|
|
if (control_mode == Mode::Number::ZIGZAG && g2.zigzag_auto_pump_enabled) { |
|
|
|
|
copter.sprayer.run(false); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// perform any cleanup required by previous flight mode
|
|
|
|
|
exit_mode(flightmode, new_flightmode); |
|
|
|
|
|
|
|
|
@ -363,6 +356,12 @@ void Copter::exit_mode(Mode *&old_flightmode,
@@ -363,6 +356,12 @@ void Copter::exit_mode(Mode *&old_flightmode,
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if MODE_ZIGZAG_ENABLED == ENABLED |
|
|
|
|
if (old_flightmode == &mode_zigzag) { |
|
|
|
|
mode_zigzag.exit(); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if FRAME_CONFIG == HELI_FRAME |
|
|
|
|
// firmly reset the flybar passthrough to false when exiting acro mode.
|
|
|
|
|
if (old_flightmode == &mode_acro) { |
|
|
|
|