summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {