-
Notifications
You must be signed in to change notification settings - Fork 1.7k
vtx_fix #11293
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: master
Are you sure you want to change the base?
vtx_fix #11293
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
ⓘ Your approaching your monthly quota for Qodo. Upgrade your plan PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | ||
| "----", "25 ", "200 ", "500 ", "800 ", " " | ||
| "25", "200 ", "500 ", "1000 ", "3000 ", " " | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: To prevent a potential buffer overflow, shorten the power level strings in saPowerNames to a maximum of 4 characters. The sa21PowerNames buffer can only hold strings up to 4 characters plus a null terminator. [possible issue, importance: 10]
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | |
| "----", "25 ", "200 ", "500 ", "800 ", " " | |
| "25", "200 ", "500 ", "1000 ", "3000 ", " " | |
| }; | |
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | |
| "25 ", "200 ", "500 ", "1000", "3000", " " | |
| }; |
| #define VTX_SMARTAUDIO_CHANNEL_COUNT (VTX_SMARTAUDIO_MAX_CHANNEL - VTX_SMARTAUDIO_MIN_CHANNEL + 1) | ||
|
|
||
| #define VTX_SMARTAUDIO_MAX_POWER_COUNT 5 | ||
| #define VTX_SMARTAUDIO_DEFAULT_POWER_COUNT 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Update VTX_SMARTAUDIO_DEFAULT_POWER_COUNT from 4 to 5 to match the number of power levels in the saPowerNames array. [possible issue, importance: 7]
| #define VTX_SMARTAUDIO_DEFAULT_POWER_COUNT 4 | |
| #define VTX_SMARTAUDIO_DEFAULT_POWER_COUNT 5 |
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | ||
| "----", "25 ", "200 ", "500 ", "800 ", " " | ||
| "25", "200 ", "500 ", "1000 ", "3000 ", " " | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Don’t remove the placeholder/sentinel entry if other code expects power level indices to start after it; keep a consistent “unknown/invalid” entry at index 0 (or update all index users accordingly). [Learned best practice, importance: 6]
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | |
| "----", "25 ", "200 ", "500 ", "800 ", " " | |
| "25", "200 ", "500 ", "1000 ", "3000 ", " " | |
| }; | |
| const char * saPowerNames[VTX_SMARTAUDIO_MAX_POWER_COUNT + 1] = { | |
| "----", "25 ", "200 ", "500 ", "1000", "3000" | |
| }; |
| #define VTX_SMARTAUDIO_MIN_FREQUENCY_MHZ 1000 //min freq in MHz | ||
| #define VTX_SMARTAUDIO_MAX_FREQUENCY_MHZ 8000 //max freq in MHz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Tighten the allowed frequency range to match actual supported tables/hardware and avoid accepting invalid configuration values (or add explicit validation elsewhere before applying the frequency). [Learned best practice, importance: 5]
| #define VTX_SMARTAUDIO_MIN_FREQUENCY_MHZ 1000 //min freq in MHz | |
| #define VTX_SMARTAUDIO_MAX_FREQUENCY_MHZ 8000 //max freq in MHz | |
| #define VTX_SMARTAUDIO_MIN_FREQUENCY_MHZ 1000 // min freq in MHz | |
| #define VTX_SMARTAUDIO_MAX_FREQUENCY_MHZ 6250 // max freq in MHz (highest supported channel) |
PR Type
Bug fix
Description
This description is generated by an AI tool. It may have inaccuracies
Updated SmartAudio power level names to match actual transmitter values
Corrected frequency range limits from 5000-5999 MHz to 1000-8000 MHz
Fixed 5.8GHz band A frequency table with corrected channel frequencies
Diagram Walkthrough
File Walkthrough
vtx_smartaudio.c
Updated SmartAudio power level namessrc/main/io/vtx_smartaudio.c
"500", "1000", "3000"
vtx_smartaudio.h
Corrected frequency range limitssrc/main/io/vtx_smartaudio.h
vtx_string.c
Fixed 5.8GHz band A frequenciessrc/main/io/vtx_string.c