diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2021-01-29 16:43:45 -0600 |
---|---|---|
committer | Harsh Sharma <harsh.sharma@multitech.com> | 2021-01-29 16:43:45 -0600 |
commit | be85ff3b063601e467f9212e7ce9aa1b7afd4bd9 (patch) | |
tree | 9d4910b74fd430dbf713a847cb0487cd646c1bcb /libloragw/src/loragw_hal.c | |
parent | 5ab2ffb580da0a84cb6ffe88545ec5e4f3d2e6f3 (diff) | |
parent | 71a8866e4ba1000ffd5df0a871009a4545c0e855 (diff) | |
download | lora_gateway_mtac_full-be85ff3b063601e467f9212e7ce9aa1b7afd4bd9.tar.gz lora_gateway_mtac_full-be85ff3b063601e467f9212e7ce9aa1b7afd4bd9.tar.bz2 lora_gateway_mtac_full-be85ff3b063601e467f9212e7ce9aa1b7afd4bd9.zip |
Merge branch 'master' of gitlab.multitech.net:lora_enterprise/lora_gateway_mtac_full
Diffstat (limited to 'libloragw/src/loragw_hal.c')
-rw-r--r-- | libloragw/src/loragw_hal.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c index c723be9..2627aaf 100644 --- a/libloragw/src/loragw_hal.c +++ b/libloragw/src/loragw_hal.c @@ -1439,8 +1439,14 @@ int lgw_send(struct lgw_pkt_tx_s pkt_data) { /* loading TX imbalance correction */ target_mix_gain = txgain_lut.lut[pow_index].mix_gain; - /* Set digital gain from LUT */ - lgw_reg_w(LGW_TX_GAIN, txgain_lut.lut[pow_index].dig_gain); + + if (pkt_data.dig_gain == -1 || pkt_data.dig_gain > 3) { + /* Set digital gain from LUT */ + lgw_reg_w(LGW_TX_GAIN, txgain_lut.lut[pow_index].dig_gain); + } else { + /* Set digital gain set by forwarder */ + lgw_reg_w(LGW_TX_GAIN, pkt_data.dig_gain); + } } if (pkt_data.rf_chain == 0) { /* use radio A calibration table */ |