From 0a005b9a3f5f3e346d9bfb323ef15e34647ff04d Mon Sep 17 00:00:00 2001 From: Henry Potgieter Date: Mon, 30 Mar 2026 01:41:28 -0400 Subject: [PATCH] Move logic for LORA PA Auto Detection for specific Heltec v4 PA's --- Utilities.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Utilities.h b/Utilities.h index 8892f59..1473b55 100644 --- a/Utilities.h +++ b/Utilities.h @@ -1287,7 +1287,13 @@ int getTxPower() { } #if HAS_LORA_PA - const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES}; + #if LORA_PA_AUTO_DETECT + static const int gc1109_tx_gain[PA_GAIN_POINTS] = {PA_GC1109_GAIN_VALUES}; + static const int kct8103l_tx_gain[PA_GAIN_POINTS] = {PA_KCT8103L_GAIN_VALUES}; + const int* tx_gain = sx126x_modem.isKCT8103L() ? kct8103l_tx_gain : gc1109_tx_gain; + #else + const int tx_gain[PA_GAIN_POINTS] = {PA_GAIN_VALUES}; + #endif #endif int map_target_power_to_modem_output(int target_tx_power) {