transceiver: fix energy threshold bug
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: 504cad4147f1e500be0a169b9f46375eaf875953@2655 19bc5d8c-e614-43d4-8b26-e1612bc8e597

hongyunnchen/openbts,endaga/openbts,WindyCitySDR/openbts,brunoflce/pessoalopenBTS,xyzr0482/openbts,Djimmer/obts,xyzr0482/openbts,maxifree/openbts,WindyCitySDR/openbts,maxifree/openbts,endaga/openbts,RangeNetworks/openbts,brunoflce/pessoalopenBTS,endaga/openbts,WindyCitySDR/openbts,brunoflce/pessoalopenBTS,hongyunnchen/openbts,Djimmer/obts,Djimmer/obts,RangeNetworks/openbts,xyzr0482/openbts,WindyCitySDR/openbts,hongyunnchen/openbts,RangeNetworks/openbts,Djimmer/obts,Djimmer/obts,maxifree/openbts,Djimmer/obts,endaga/openbts,brunoflce/pessoalopenBTS,dhenyjarasandy/openbts,WindyCitySDR/openbts,maxifree/openbts,dhenyjarasandy/openbts,xyzr0482/openbts,endaga/openbts,brunoflce/pessoalopenBTS,dhenyjarasandy/openbts,hongyunnchen/openbts,RangeNetworks/openbts,xyzr0482/openbts,dhenyjarasandy/openbts,maxifree/openbts,RangeNetworks/openbts,hongyunnchen/openbts,RangeNetworks/openbts,dhenyjarasandy/openbts