Update vtx_tramp.c - #11772
Conversation
vtx 2500
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
PR Summary by QodoAdd 2.5W power table selection for Tramp 5.8GHz VTX
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. 800mW power capped
|
| if (maxPower >= 2500) { | ||
| vtxState.metadata.powerTablePtr = trampPowerTable_5G8_2500; | ||
| vtxState.metadata.powerTableCount = 4; | ||
|
|
There was a problem hiding this comment.
1. 800mw power capped 🐞 Bug ≡ Correctness
vtxProtoUpdatePowerMetadata() now only selects the new 2500mW table when maxPower>=2500; a TRAMP VTX reporting maxPower=800 will fall through to the 600mW table and can never request 800mW. This causes incorrect capability metadata and prevents users from using the device’s supported max power.
Agent Prompt
## Issue description
The TRAMP 5.8GHz power metadata selection no longer handles devices whose reported `maxPower` is >=800mW but <2500mW, so those devices use the 600mW table and cannot select 800mW.
## Issue Context
`vtxProtoProcessResponse()` reads `capabilities.powerMax` from the VTX and calls `vtxProtoUpdatePowerMetadata(powerMax)`. Power selection (`impl_SetPowerByIndex`) uses `vtxState.metadata.powerTablePtr` values; if the selected table does not include 800, the firmware cannot ever request 800mW (even though it caps requested power to `powerMax`).
## Fix Focus Areas
- src/main/io/vtx_tramp.c[563-574]
- src/main/io/vtx_tramp.c[581-645]
- src/main/io/vtx_tramp.c[428-443]
## Proposed fix
1. Reintroduce the 5.8GHz 800mW power table + names (the prior 25/100/200/500/800 mapping).
2. Add an `else if (maxPower >= 800)` branch between the 2500 and 600 branches to select that table and set matching `powerTableCount`/`capability.powerCount`.
3. Keep the 2500mW handling as the top branch for `maxPower >= 2500`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
vtx 2500