-
Notifications
You must be signed in to change notification settings - Fork 1.7k
IRC Tramp CLI Power Tables #11217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maintenance-9.x
Are you sure you want to change the base?
IRC Tramp CLI Power Tables #11217
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
|
Thanks for doing your first INAV PR! A lot of people will be very happy about this, because they've been asking for it for a long time. This is great, if it works out. You mentioned comments. Let me comment on comments. :) That's great code - totally self-explanatory. Someone who isn't even a programmer could likely read and pretty much understand that because it reads pretty much like English prose. If cmdLine is empty, print an error and return. Awesome. THEREFORE, the comment repeating what the code says may be unnecessary noise that actually ends up making the code harder to read by making it longer: There's also the question there of -- are the comments before the code or after? Hmm, both? But here there is nothing to explain - it's great, self-evident code. Typically, comments should describe WHY the code is doing something that isn't obvious. This certainly might! A comment could say 0.0 is added to make it a float. ( Though maybe explicitly casting to a float would be better in that example.) We have a function called constructPowerTable(). Which contructs the power table, of course. |
…ed better range checks to PL commands. Hooked the new configuration into settings.yaml. Added preprocessor conditionals to static functions for tramp PL configuration to ensure that when the tramp option excludes the commands from the build the static processing functions are not left unused. Added tramp_pl_table command to ease updating the configuration in the cases where no default hard coded PL table values are to be reused. If less than the max number of PL entries are provided, remaining entries are filled with that of the last passed PL to ensure that the default values are not used. Tested on F405, worked without issue.
This all sounds good to me. Took a pass through and cleaned up the comments. Additionally, this commit should fix the unused static function errros from SITL builds. Had the commands in preprocessor conditionals but not the static functions used to service those commands. The functions should now follow the command definitions |
Summary
Testing
This has been tested with an ATOMRC F405 NAVI on the ground communicating with a stubborn VTX. This VTX was particulary impacted by the default tables as its PLs are set as 1, 2, and 3 in place of milliwatt values, making the defaults impossible to use. Changing PL entries 1, 2, and 3 to 1, 2, and 3 milliwatts respectively fixed this issue and the VTX correctly transitioned to higher PLs on command. Non-volatile storage was tested and saved values were recovered across power cycles. Configuration reset was also tested and all values initialized to -1 as expected. Additional board tests may be required.
Please Note: This contains a settings change and will most likely require a diff all + full erase + reapplication of original config in order to perform further testing.
Related
This may fix the following discussions/issues:
Other Notes
I apologize in advance for any coding standards inconsistencies. I regularly use a slightly different set and some issues may have slipped through. Additionally, I have left a fair quantity of comments. Some of these may not be as useful, but I tend to err on the side of more comments rather than less to assist with later maintenance. I can remove the majority of these if they just add noise.