Plane: never stick mix without valid RC input

This commit is contained in:
Iampete1 2022-03-08 15:05:19 +00:00 committed by Andrew Tridgell
parent bb3bedb90d
commit a7bc844780

View File

@ -61,6 +61,10 @@ float Plane::calc_speed_scaler(void)
*/ */
bool Plane::stick_mixing_enabled(void) bool Plane::stick_mixing_enabled(void)
{ {
if (!rc().has_valid_input()) {
// never stick mix without valid RC
return false;
}
#if AC_FENCE == ENABLED #if AC_FENCE == ENABLED
const bool stickmixing = fence_stickmixing(); const bool stickmixing = fence_stickmixing();
#else #else
@ -81,9 +85,7 @@ bool Plane::stick_mixing_enabled(void)
// we're in an auto mode. Check the stick mixing flag // we're in an auto mode. Check the stick mixing flag
if (g.stick_mixing != StickMixing::NONE && if (g.stick_mixing != StickMixing::NONE &&
g.stick_mixing != StickMixing::VTOL_YAW && g.stick_mixing != StickMixing::VTOL_YAW &&
stickmixing && stickmixing) {
!rc_failsafe_active()) {
// we're in an auto mode, and haven't triggered rc failsafe
return true; return true;
} else { } else {
return false; return false;