Enable LNA by default for Heltec v4.3 (#9906)
It should only be disabled by users that have problems with it.
This commit is contained in:
committed by
Ben Meadors
co-authored by
Ben Meadors
parent
e4c5bfd161
commit
532a63e541
@@ -25,7 +25,7 @@ void LoRaFEMInterface::init(void)
|
|||||||
pinMode(LORA_KCT8103L_PA_CSD, OUTPUT);
|
pinMode(LORA_KCT8103L_PA_CSD, OUTPUT);
|
||||||
digitalWrite(LORA_KCT8103L_PA_CSD, HIGH);
|
digitalWrite(LORA_KCT8103L_PA_CSD, HIGH);
|
||||||
pinMode(LORA_KCT8103L_PA_CTX, OUTPUT);
|
pinMode(LORA_KCT8103L_PA_CTX, OUTPUT);
|
||||||
digitalWrite(LORA_KCT8103L_PA_CTX, HIGH);
|
digitalWrite(LORA_KCT8103L_PA_CTX, LOW); // LNA enabled by default
|
||||||
setLnaCanControl(true);
|
setLnaCanControl(true);
|
||||||
} else if (digitalRead(LORA_KCT8103L_PA_CSD) == LOW) {
|
} else if (digitalRead(LORA_KCT8103L_PA_CSD) == LOW) {
|
||||||
// FEM is GC1109
|
// FEM is GC1109
|
||||||
@@ -66,7 +66,7 @@ void LoRaFEMInterface::init(void)
|
|||||||
pinMode(LORA_KCT8103L_PA_CSD, OUTPUT);
|
pinMode(LORA_KCT8103L_PA_CSD, OUTPUT);
|
||||||
digitalWrite(LORA_KCT8103L_PA_CSD, HIGH);
|
digitalWrite(LORA_KCT8103L_PA_CSD, HIGH);
|
||||||
pinMode(LORA_KCT8103L_PA_CTX, OUTPUT);
|
pinMode(LORA_KCT8103L_PA_CTX, OUTPUT);
|
||||||
digitalWrite(LORA_KCT8103L_PA_CTX, HIGH);
|
digitalWrite(LORA_KCT8103L_PA_CTX, LOW); // LNA enabled by default
|
||||||
setLnaCanControl(true);
|
setLnaCanControl(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class LoRaFEMInterface
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
LoRaFEMType fem_type;
|
LoRaFEMType fem_type;
|
||||||
bool lna_enabled = false;
|
bool lna_enabled = true;
|
||||||
bool lna_can_control = false;
|
bool lna_can_control = false;
|
||||||
};
|
};
|
||||||
extern LoRaFEMInterface loraFEMInterface;
|
extern LoRaFEMInterface loraFEMInterface;
|
||||||
|
|||||||
+1
-1
@@ -569,7 +569,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
|||||||
config.lora.override_duty_cycle = false;
|
config.lora.override_duty_cycle = false;
|
||||||
config.lora.config_ok_to_mqtt = false;
|
config.lora.config_ok_to_mqtt = false;
|
||||||
#if HAS_LORA_FEM
|
#if HAS_LORA_FEM
|
||||||
config.lora.fem_lna_mode = meshtastic_Config_LoRaConfig_FEM_LNA_Mode_DISABLED;
|
config.lora.fem_lna_mode = meshtastic_Config_LoRaConfig_FEM_LNA_Mode_ENABLED;
|
||||||
#else
|
#else
|
||||||
config.lora.fem_lna_mode = meshtastic_Config_LoRaConfig_FEM_LNA_Mode_NOT_PRESENT;
|
config.lora.fem_lna_mode = meshtastic_Config_LoRaConfig_FEM_LNA_Mode_NOT_PRESENT;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ template <typename T> bool SX126xInterface<T>::init()
|
|||||||
loraFEMInterface.init();
|
loraFEMInterface.init();
|
||||||
// Apply saved FEM LNA mode from config
|
// Apply saved FEM LNA mode from config
|
||||||
if (loraFEMInterface.isLnaCanControl()) {
|
if (loraFEMInterface.isLnaCanControl()) {
|
||||||
loraFEMInterface.setLNAEnable(config.lora.fem_lna_mode == meshtastic_Config_LoRaConfig_FEM_LNA_Mode_ENABLED);
|
loraFEMInterface.setLNAEnable(config.lora.fem_lna_mode != meshtastic_Config_LoRaConfig_FEM_LNA_Mode_DISABLED);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -800,7 +800,7 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
#if HAS_LORA_FEM
|
#if HAS_LORA_FEM
|
||||||
// Apply FEM LNA mode from config (only meaningful on hardware that supports it)
|
// Apply FEM LNA mode from config (only meaningful on hardware that supports it)
|
||||||
if (loraFEMInterface.isLnaCanControl()) {
|
if (loraFEMInterface.isLnaCanControl()) {
|
||||||
loraFEMInterface.setLNAEnable(config.lora.fem_lna_mode == meshtastic_Config_LoRaConfig_FEM_LNA_Mode_ENABLED);
|
loraFEMInterface.setLNAEnable(config.lora.fem_lna_mode != meshtastic_Config_LoRaConfig_FEM_LNA_Mode_DISABLED);
|
||||||
} else if (config.lora.fem_lna_mode != meshtastic_Config_LoRaConfig_FEM_LNA_Mode_NOT_PRESENT) {
|
} else if (config.lora.fem_lna_mode != meshtastic_Config_LoRaConfig_FEM_LNA_Mode_NOT_PRESENT) {
|
||||||
// Hardware FEM does not support LNA control; normalize stored config to match actual capability
|
// Hardware FEM does not support LNA control; normalize stored config to match actual capability
|
||||||
LOG_WARN("FEM LNA mode configured but current FEM does not support LNA control; normalizing to NOT_PRESENT");
|
LOG_WARN("FEM LNA mode configured but current FEM does not support LNA control; normalizing to NOT_PRESENT");
|
||||||
|
|||||||
Reference in New Issue
Block a user