aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Transceiver52M/radioInterface.cpp')
-rw-r--r--Transceiver52M/radioInterface.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index e8eea6f..7e51fa4 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -101,15 +101,14 @@ double RadioInterface::fullScaleOutputValue(void) {
}
-void RadioInterface::setPowerAttenuation(double dBAtten)
+void RadioInterface::setPowerAttenuation(double atten)
{
double HWatten = mRadio->setTxGain(mRadio->maxTxGain() - atten);
- atten -= (-HWatten);
+ atten -= HWatten;
if (atten < 1.0)
powerScaling = 1.0;
else
- powerScaling = 1.0/sqrt(linearAtten);
- LOG(INFO) << "setting HW gain to " << HWdBAtten << " and power scaling to " << powerScaling;
+ powerScaling = 1.0 / sqrt(pow(10, (atten / 10.0)));
}