From 22b1efc34560e44cbf9a75782d817ea41413cc69 Mon Sep 17 00:00:00 2001 From: Nick Dunklee Date: Wed, 27 May 2026 15:19:31 -0600 Subject: [PATCH] fix(heltec_t096): fix lna_enable in LoRaFEMControl and code cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set lna_enabled=true in LoRaFEMControl so KCT8103L enters RX/LNA mode (CTX=LOW) during receive instead of remaining in TX mode. Matching Heltec V4 default for the same chip. Reduces idle power draw during the dominant receive state. - Remove setRxModeEnableWhenMCUSleep() — dead code on nRF52. Unlike ESP32 deep sleep, nRF52 preserves GPIO state automatically. --- variants/heltec_t096/LoRaFEMControl.cpp | 10 ---------- variants/heltec_t096/LoRaFEMControl.h | 3 +-- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/variants/heltec_t096/LoRaFEMControl.cpp b/variants/heltec_t096/LoRaFEMControl.cpp index fb60a8f781..d072130e44 100644 --- a/variants/heltec_t096/LoRaFEMControl.cpp +++ b/variants/heltec_t096/LoRaFEMControl.cpp @@ -35,16 +35,6 @@ void LoRaFEMControl::setRxModeEnable(void) } } -void LoRaFEMControl::setRxModeEnableWhenMCUSleep(void) -{ - digitalWrite(P_LORA_KCT8103L_PA_CSD, HIGH); - if (lna_enabled) { - digitalWrite(P_LORA_KCT8103L_PA_CTX, LOW); - } else { - digitalWrite(P_LORA_KCT8103L_PA_CTX, HIGH); - } -} - void LoRaFEMControl::setLNAEnable(bool enabled) { lna_enabled = enabled; diff --git a/variants/heltec_t096/LoRaFEMControl.h b/variants/heltec_t096/LoRaFEMControl.h index 2c50b74289..c65f6c27e2 100644 --- a/variants/heltec_t096/LoRaFEMControl.h +++ b/variants/heltec_t096/LoRaFEMControl.h @@ -10,12 +10,11 @@ class LoRaFEMControl void setSleepModeEnable(void); void setTxModeEnable(void); void setRxModeEnable(void); - void setRxModeEnableWhenMCUSleep(void); void setLNAEnable(bool enabled); bool isLnaCanControl(void) { return lna_can_control; } void setLnaCanControl(bool can_control) { lna_can_control = can_control; } private: - bool lna_enabled = false; + bool lna_enabled = true; bool lna_can_control = false; };