Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/main/io/vtx_tramp.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ const char * const trampPowerNames_5G8_400[VTX_TRAMP_5G8_MAX_POWER_COUNT + 1] =
const uint16_t trampPowerTable_5G8_600[VTX_TRAMP_5G8_MAX_POWER_COUNT] = { 25, 100, 200, 400, 600 };
const char * const trampPowerNames_5G8_600[VTX_TRAMP_5G8_MAX_POWER_COUNT + 1] = { "---", "25 ", "100", "200", "400", "600" };

const uint16_t trampPowerTable_5G8_800[VTX_TRAMP_5G8_MAX_POWER_COUNT] = { 25, 100, 200, 500, 800 };
const char * const trampPowerNames_5G8_800[VTX_TRAMP_5G8_MAX_POWER_COUNT + 1] = { "---", "25 ", "100", "200", "500", "800" };
const uint16_t trampPowerTable_5G8_2500[VTX_TRAMP_5G8_MAX_POWER_COUNT] = { 25, 400, 1000, 2500, 2500};
const char * const trampPowerNames_5G8_2500[VTX_TRAMP_5G8_MAX_POWER_COUNT +1 ] = { "---", "25 ", "400", "1000", "2500" };

const uint16_t trampPowerTable_1G3_800[VTX_TRAMP_1G3_MAX_POWER_COUNT] = { 25, 200, 800 };
const char * const trampPowerNames_1G3_800[VTX_TRAMP_1G3_MAX_POWER_COUNT + 1] = { "---", "25 ", "200", "800" };
Expand Down Expand Up @@ -602,14 +602,13 @@ static void vtxProtoUpdatePowerMetadata(uint16_t maxPower)
impl_vtxDevice.capability.channelNames = (char **)vtx1G3ChannelNames;
break;
default:
if (maxPower >= 800) {
// Max power 800mW: Use 25, 100, 200, 500, 800 table
vtxState.metadata.powerTablePtr = trampPowerTable_5G8_800;
vtxState.metadata.powerTableCount = VTX_TRAMP_5G8_MAX_POWER_COUNT;
if (maxPower >= 2500) {
vtxState.metadata.powerTablePtr = trampPowerTable_5G8_2500;
vtxState.metadata.powerTableCount = 4;

Comment on lines +605 to 608

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

impl_vtxDevice.capability.powerNames = (char **)trampPowerNames_5G8_800;
impl_vtxDevice.capability.powerCount = VTX_TRAMP_5G8_MAX_POWER_COUNT;
}
impl_vtxDevice.capability.powerNames = (char **)trampPowerNames_5G8_2500;
impl_vtxDevice.capability.powerCount = 4;
}
else if (maxPower >= 600) {
// Max power 600mW: Use 25, 100, 200, 400, 600 table
vtxState.metadata.powerTablePtr = trampPowerTable_5G8_600;
Expand Down
Loading