mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
feat(RadioInterface): Tx power gain calculation rework (#6796)
- Rename REGULATORY_GAIN_LORA to TX_GAIN_LORA - Move gain-based Tx power clamping from RadioInterface::applyModemConfig() to RadioInterface::limitPower() - User-configured Tx power now matches the Tx power out of the device connector - Re-order [LoRa Chip]Interface.cpp limitPower() to take place before the final Tx power clamping so we clamp based on the pre-PA Tx power rather than user-configured Tx power Tested on XIAO BLE variant. Signed-off-by: Andrew Yong <me@ndoo.sg> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -71,6 +71,8 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
|
||||
RadioLibInterface::init();
|
||||
|
||||
limitPower();
|
||||
|
||||
if (power > LR1110_MAX_POWER) // Clamp power to maximum defined level
|
||||
power = LR1110_MAX_POWER;
|
||||
|
||||
@@ -80,8 +82,6 @@ template <typename T> bool LR11x0Interface<T>::init()
|
||||
preambleLength = 12; // 12 is the default for operation above 2GHz
|
||||
}
|
||||
|
||||
limitPower();
|
||||
|
||||
#ifdef LR11X0_RF_SWITCH_SUBGHZ
|
||||
pinMode(LR11X0_RF_SWITCH_SUBGHZ, OUTPUT);
|
||||
digitalWrite(LR11X0_RF_SWITCH_SUBGHZ, getFreq() < 1e9 ? HIGH : LOW);
|
||||
|
||||
Reference in New Issue
Block a user