From a3a12d996afe9e3f345ff0f35c40cd69b14ec236 Mon Sep 17 00:00:00 2001 From: richardclli Date: Fri, 22 Aug 2025 08:12:03 +0800 Subject: [PATCH] fix(afhds3): enable settings for internal TX RF Power (#6534) --- .../src/gui/colorlcd/module/afhds3_settings.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/module/afhds3_settings.cpp b/radio/src/gui/colorlcd/module/afhds3_settings.cpp index a51fc3b6d..fc92654aa 100644 --- a/radio/src/gui/colorlcd/module/afhds3_settings.cpp +++ b/radio/src/gui/colorlcd/module/afhds3_settings.cpp @@ -87,12 +87,24 @@ AFHDS3Settings::AFHDS3Settings(Window* parent, const FlexGridLayout& g, return 0; }); - if (moduleIdx == EXTERNAL_MODULE) { + bool hasPowerOption = false; + int maxPower; + if (moduleIdx == INTERNAL_MODULE) { + #if defined(RADIO_PL18U) || defined(PCBPA01) + hasPowerOption = true; + maxPower = AFHDS3_POWER_500; + #endif + } else if (moduleIdx == EXTERNAL_MODULE) { + hasPowerOption = true; + maxPower = AFHDS3_FRM303_POWER_MAX; + } + + if (hasPowerOption) { line = newLine(grid); auto cfg = afhds3::getConfig(moduleIdx); new StaticText(line, rect_t{}, STR_MULTI_RFPOWER); afhds3RfPower = new Choice( - line, rect_t{}, STR_AFHDS3_POWERS, 0, AFHDS3_FRM303_POWER_MAX, + line, rect_t{}, STR_AFHDS3_POWERS, 0, maxPower, GET_DEFAULT(md->afhds3.rfPower), [=](int32_t newValue) { md->afhds3.rfPower = newValue; cfg->others.dirtyFlag |= (uint32_t)1