Tweak PA detect gpio to use pinMapping

This commit is contained in:
Jonathan Bennett
2026-02-25 13:43:36 -06:00
parent bd36921d29
commit 350ca1f0ca
2 changed files with 1 additions and 11 deletions
+1 -6
View File
@@ -538,7 +538,7 @@ void portduinoSetup()
}
// In one test, this dance seemed necessary to trigger the pin to detect properly.
if (portduino_config.has_gpio_detect_pa) {
if (portduino_config.lora_pa_detect_pin.enabled) {
pinMode(portduino_config.lora_pa_detect_pin.pin, INPUT_PULLDOWN);
sleep(1);
if (digitalRead(portduino_config.lora_pa_detect_pin.pin) == LOW) {
@@ -681,11 +681,6 @@ bool loadConfig(const char *configPath)
portduino_config.lr1120_max_power = yamlConfig["Lora"]["LR1120_MAX_POWER"].as<int>(13);
if (yamlConfig["Lora"]["RF95_MAX_POWER"])
portduino_config.rf95_max_power = yamlConfig["Lora"]["RF95_MAX_POWER"].as<int>(20);
if (yamlConfig["Lora"]["GPIO_DETECT_PA"]) {
portduino_config.has_gpio_detect_pa = true;
portduino_config.gpio_detect_pa = yamlConfig["Lora"]["GPIO_DETECT_PA"].as<int>(0);
portduino_config.lora_pa_detect_pin.pin = portduino_config.gpio_detect_pa;
}
if (yamlConfig["Lora"]["TX_GAIN_LORA"]) {
YAML::Node tx_gain_node = yamlConfig["Lora"]["TX_GAIN_LORA"];
-5
View File
@@ -98,8 +98,6 @@ extern struct portduino_config_struct {
int lora_usb_pid = 0x5512;
int lora_usb_vid = 0x1A86;
int spiSpeed = 2000000;
bool has_gpio_detect_pa = false;
int gpio_detect_pa = 0;
int num_pa_points = 1; // default to 1 point, with 0 gain
uint16_t tx_gain_lora[22] = {0};
pinMapping lora_cs_pin = {"Lora", "CS"};
@@ -249,9 +247,6 @@ extern struct portduino_config_struct {
if (rf95_max_power != 20)
out << YAML::Key << "RF95_MAX_POWER" << YAML::Value << rf95_max_power;
if (has_gpio_detect_pa)
out << YAML::Key << "GPIO_DETECT_PA" << YAML::Value << gpio_detect_pa;
if (num_pa_points > 1) {
out << YAML::Key << "TX_GAIN_LORA" << YAML::Value << YAML::Flow << YAML::BeginSeq;
for (int i = 0; i < num_pa_points; i++) {