From 8b146fcffb9839febdc6c888cc8985245855e447 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Thu, 8 Apr 2021 11:25:18 -0500 Subject: make call to setup lgw lut when temp comp is enabled --- lora_pkt_fwd/src/lora_pkt_fwd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3