Transceiver: fix integer division in addRadioVector()

By default, C/C++ compiler does assume integer division.  The
lack of explicit cast to 'double' causes the transceiver to
ignore non-decimal attenuation values (x % 10 > 0):

  txFullScale * 10 ^ ( -3 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ ( -8 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ (-10 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

  txFullScale * 10 ^ (-18 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

Change-Id: I85b1063f57f630d90c6da32827bec4a05afc6514
Related: SYS#4918
This commit is contained in:
Vadim Yanitskiy 2021-01-21 00:12:38 +01:00
parent 54a98b5b52
commit 819cad1776
1 changed files with 1 additions and 1 deletions

View File

@ -396,7 +396,7 @@ void Transceiver::addRadioVector(size_t chan, BitVector &bits,
else
burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), cfg->tx_sps);
scaleVector(*burst, txFullScale * pow(10, -RSSI / 10));
scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 10));
radio_burst = new radioVector(wTime, burst);