Repository navigation
Unify code for setting link parameters from UI - #3472
Merged
Merged
Conversation
pkendall64
approved these changes
Dec 31, 2025
pkendall64
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. I'm just not sure about these extra tx_* global functions.
Something for future us to think about I suppose.
Member
Author
|
Yeah I was pretty unhappy with that myself. I've pushed a slightly different design where the screen just calls the EDIT: Also moved SetMaxPower and SetDynamicPower to shared implementations. All this sharing has reduced code size 240 bytes too! |
Collaborator
|
Nice. I'm cool with that. |
CapnBry
force-pushed
the
unify-txconfset
branch
from
January 2, 2026 20:10
54d376d to
72240dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unifies the UI -> config setting code between screen devices and lua for Packet Rate, Antenna Mode, Switch Mode, and TLM Ratio. Logic not being copy pasted between the two had lead to different behaviors and broken telemetry in X-Band modes.
Fixes #3471. To reproduce this bug, the Antenna mode has to not be set to Gemini before switching the Band to an X mode. The antenna mode stays in not-Gemini, and the telemetry receiver can't reassemble the data properly because only one of the two radios' data is used,
Details
The real problem identified in #3471 is that setting the Band to X-Band in the lua simply sets the packet rate to X150 and calls it a day. For telemetry to work properly in any Gemini mode (of which X150 is), the antenna mode must be forced to Gemini, and the Band lua item skipped that check.
The Packet Rate lua item also was missing the check, but the screen's Packet Rate setter included it. The lua version of this parameter also included logic restricting changes in Mavlink mode, but the screen's version did not.
Fix
To resolve this, I have unified the setting of the packet rate from the UI so that all methods (automatic on band switch, lua set, screen set) call the same function. There may be additional logic needed for linkMode == MAVLINK to adjust the switch mode to be appropriate on band change.
And then I did the other setters, most of which matched their duplicate implementations!