diff --git a/src/modules/gimbal/gimbal.cpp b/src/modules/gimbal/gimbal.cpp index a0842a6447..137f38c644 100644 --- a/src/modules/gimbal/gimbal.cpp +++ b/src/modules/gimbal/gimbal.cpp @@ -197,6 +197,8 @@ static int gimbal_thread_main(int argc, char *argv[]) thread_should_exit.store(true); } + const unsigned int poll_timeout_ms = params.mnt_mode_out == MNT_MODE_OUT_AUX ? 10 : 20; + while (!thread_should_exit.load()) { const bool updated = parameter_update_sub.updated(); @@ -219,7 +221,7 @@ static int gimbal_thread_main(int argc, char *argv[]) const bool already_active = (thread_data.last_input_active == i); // poll only on active input to reduce latency, or on all if none is active const unsigned int poll_timeout = - (already_active || thread_data.last_input_active == -1) ? 20 : 0; + (already_active || thread_data.last_input_active == -1) ? poll_timeout_ms : 0; update_result = thread_data.input_objs[i]->update(poll_timeout, thread_data.control_data, already_active);