diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 9c75e98ebf..ea487749c6 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -699,7 +699,7 @@ static void applyFlipOverAfterCrashModeToMotors(void) signYaw = 0; } - const float cosPhi = (stickDeflectionPitchAbs + stickDeflectionRollAbs) / (sqrtf(2.0f) * stickDeflectionLength); + const float cosPhi = (stickDeflectionLength > 0) ? (stickDeflectionPitchAbs + stickDeflectionRollAbs) / (sqrtf(2.0f) * stickDeflectionLength) : 0; const float cosThreshold = sqrtf(3.0f)/2.0f; // cos(PI/6.0f) if (cosPhi < cosThreshold) {