aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-09-09 10:20:58 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-09-09 10:20:58 +0200
commit0d56d75dbb5febd5aa8e9bc29dfb03249a505aa6 (patch)
treef525521d4c131c0ae10d6cfb094489e7b15f2cd1
parent94c52414031904571e7ab1d4b924ea63ce76d8a9 (diff)
Transceiver: pullRadioVector(): Fix use of uninitialized value bi->tn
-rw-r--r--Transceiver52M/Transceiver.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 079d1d7..3901997 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -612,19 +612,6 @@ bool Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
burstTime = radio_burst->getTime();
CorrType type = expectedCorrType(burstTime, chan);
- /* Debug: dump bursts to disk */
- /* bits 0-7 - chan 0 timeslots
- * bits 8-15 - chan 1 timeslots */
- if (mWriteBurstToDiskMask & ((1<<bi->tn) << (8*chan)))
- writeToFile(radio_burst, chan);
-
- /* No processing if the timeslot is off.
- * Not even power level or noise calculation. */
- if (type == OFF) {
- delete radio_burst;
- return false;
- }
-
/* Initialize struct bi */
bi->nbits = 0;
bi->fn = burstTime.FN();
@@ -638,6 +625,19 @@ bool Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
bi->tsc = 0;
bi->ci = 0.0;
+ /* Debug: dump bursts to disk */
+ /* bits 0-7 - chan 0 timeslots
+ * bits 8-15 - chan 1 timeslots */
+ if (mWriteBurstToDiskMask & ((1<<bi->tn) << (8*chan)))
+ writeToFile(radio_burst, chan);
+
+ /* No processing if the timeslot is off.
+ * Not even power level or noise calculation. */
+ if (type == OFF) {
+ delete radio_burst;
+ return false;
+ }
+
/* Select the diversity channel with highest energy */
for (size_t i = 0; i < radio_burst->chans(); i++) {
float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);