summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2021-04-08 11:25:18 -0500
committerJason Reiss <jreiss@multitech.com>2021-04-08 11:25:18 -0500
commit8b146fcffb9839febdc6c888cc8985245855e447 (patch)
tree59c3b74baae0be7a68932f985c7c14f1a2383cd8
parent89c9e05e866c708ed594c71dd7b2c18387b3a6b7 (diff)
downloadpacket_forwarder_mtac_full-8b146fcffb9839febdc6c888cc8985245855e447.tar.gz
packet_forwarder_mtac_full-8b146fcffb9839febdc6c888cc8985245855e447.tar.bz2
packet_forwarder_mtac_full-8b146fcffb9839febdc6c888cc8985245855e447.zip
make call to setup lgw lut when temp comp is enabled4.0.4-2
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
index 85be120..754249b 100644
--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
+++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
@@ -853,6 +853,7 @@ static int parse_SX1301_configuration(const char * conf_file) {
MSG("INFO: Loading temperature compensated LUT values\n");
for (i = 0; i < TX_GAIN_LUT_SIZE_MAX; i++) {
+ txlut.size++;
txlut.lut[i].rf_power = tx_temp_lut.base[i].rf_power;
txlut.lut[i].pa_gain = tx_temp_lut.base[i].pa_gain;
txlut.lut[i].mix_gain = tx_temp_lut.base[i].mix_gain;
@@ -860,6 +861,17 @@ static int parse_SX1301_configuration(const char * conf_file) {
txlut.lut[i].dac_gain = 3;
MSG("LUT %d RF: %d PA: %d MIX: %d DIG: %d DAC: %d\n", i, txlut.lut[i].rf_power, txlut.lut[i].pa_gain, txlut.lut[i].mix_gain, txlut.lut[i].dig_gain, txlut.lut[i].dac_gain);
}
+ /* all parameters parsed, submitting configuration to the HAL */
+ if (txlut.size > 0) {
+ MSG("INFO: Configuring TX LUT with %u indexes\n", txlut.size);
+ if (lgw_txgain_setconf(&txlut) != LGW_HAL_SUCCESS) {
+ MSG("ERROR: Failed to configure concentrator TX Gain LUT\n");
+ return -1;
+ }
+ } else {
+ MSG("WARNING: No TX gain LUT defined\n");
+ }
+
} else {
/* set configuration for tx gains */
@@ -1995,7 +2007,7 @@ int main(int argc, char** argv)
MSG("WARNING: lgw page was unexpectedly changed, process is exiting.\n");
break;
}
-
+
static uint32_t last_tstamp = 0;
static uint32_t rollover_cnt = 0;
if (trig_tstamp < last_tstamp) {