From 9ca68415589a0a0a9c97c72f609fd5d40c834ed4 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 29 Apr 2026 15:07:44 +0300 Subject: [PATCH] Exit auto mode when sticks moved only when mode switch is not configured --- docs/usage.md | 2 +- flix/safety.ino | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 974f851..18493e8 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -266,7 +266,7 @@ In this mode, the pilot controls the angular rates. This control method is diffi In this mode, the pilot inputs are ignored (except the mode switch). The drone can be controlled using [pyflix](../tools/pyflix/) Python library, or by modifying the firmware to implement the needed behavior. -If the pilot moves the control sticks, the drone will switch back to *STAB* mode. +If the pilot moves the control sticks and mode switch is not configured, the drone will switch back to *STAB* mode. ## Wi-Fi configuration diff --git a/flix/safety.ino b/flix/safety.ino index 1d67010..05fd758 100644 --- a/flix/safety.ino +++ b/flix/safety.ino @@ -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;