Skip to content

Conversation

@Stary2001
Copy link
Member

I've implemented support for TX_GAIN_LORA in the portduino yaml config. Also refactors the code a little bit to support choosing linear/nonlinear gain at runtime for this.
Tested with this config:

Lora:
 Module: sx1262
 DIO2_AS_RF_SWITCH: true
 DIO3_TCXO_VOLTAGE: true
 CS: 8
 IRQ: 27
 Busy: 22
 Reset: 23
 TX_GAIN_LORA: 20
 SX1262_MAX_POWER: 12

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • native
    • T1000E

@Stary2001 Stary2001 added enhancement New feature or request linux-native related to running meshtastic as daemon on native linux labels Oct 31, 2025
Copilot finished reviewing on behalf of thebentern November 17, 2025 12:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements support for configuring TX_GAIN_LORA values through the portduino YAML configuration file, adding the ability to specify either a single gain value or an array of values for nonlinear power amplifiers. The implementation refactors the existing compile-time TX_GAIN_LORA handling to support runtime configuration on portduino platforms.

Key Changes:

  • Added num_pa_points and tx_gain_lora[] array to portduino configuration structure
  • Unified linear and nonlinear gain handling in RadioInterface to work with both compile-time (non-portduino) and runtime (portduino) configurations
  • Added YAML parsing and serialization for the new TX_GAIN_LORA configuration field

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/platform/portduino/PortduinoGlue.h Added struct members for storing TX_GAIN_LORA values and YAML serialization logic
src/platform/portduino/PortduinoGlue.cpp Implemented YAML parsing for TX_GAIN_LORA configuration (single value or array)
src/mesh/RadioInterface.cpp Refactored power limiting logic to support both compile-time and runtime TX_GAIN_LORA values
src/configuration.h Added default NUM_PA_POINTS definition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request linux-native related to running meshtastic as daemon on native linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants