Exit auto mode when sticks moved only when mode switch is not configured

This commit is contained in:
Oleg Kalachev
2026-04-29 15:07:44 +03:00
parent 28da2d3c8e
commit 9ca6841558
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ void descend() {
void autoFailsafe() {
static float roll, pitch, yaw, throttle;
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
// controls changed
if (mode == AUTO) mode = STAB; // regain control by the pilot
// controls changed and mode switch is not configured
if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
}
roll = controlRoll;
pitch = controlPitch;