aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:52 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:52 +0000
commit3ed6fb7755c1e1158cd7acde36542e0c6f703eee (patch)
treef1f51c3ad30de1130db7500dee2279573c980d46 /Transceiver52M/Transceiver.cpp
parent7ac54b10d3373865cddd0f2e3821b0346cb9dd7c (diff)
transceiver: fix energy threshold bug
If no bursts were received over a long enough duration then the threshold would roll into negative territory. The energy detection is based on a comparison with the squared threshold, so all handsets would become effectively barred after a certain period of inactivity. In theory, this bug also exists in the mainline tree, but there the daughterboard receive gain is fixed at max, which always allows the ADC to generate sufficient noise to trigger the energy dectector and keep the system in a valid steady state. To fix, simply add a negative value check like those already in place for other locations. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 44cc86a..77577e1 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -303,6 +303,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold
mEnergyThreshold -= 10.0/10.0;
+ if (mEnergyThreshold < 0.0)
+ mEnergyThreshold = 0.0;
+
prevFalseDetectionTime = rxBurst->time();
}
delete rxBurst;