aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-25 12:26:16 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-02-25 12:26:16 +0100
commit74504a9af2ef9a34085b0065c7c993ac5346fd27 (patch)
tree18716b5f1132a3dd7d8ed56997ffd8a040b90a98 /src/OutputUHD.cpp
parent1478ff198878db23e8417aecfc936e31e3e9bec9 (diff)
downloaddabmod-74504a9af2ef9a34085b0065c7c993ac5346fd27.tar.gz
dabmod-74504a9af2ef9a34085b0065c7c993ac5346fd27.tar.bz2
dabmod-74504a9af2ef9a34085b0065c7c993ac5346fd27.zip
Fix UHD LO offset logging
Diffstat (limited to 'src/OutputUHD.cpp')
-rw-r--r--src/OutputUHD.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 072b63a..3a4511a 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -222,30 +222,30 @@ OutputUHD::OutputUHD(
}
if (myConf.lo_offset != 0.0) {
- etiLog.log(info, "OutputUHD:Setting freq to %f with LO offset %f...\n",
- myConf.frequency, myConf.lo_offset);
+ etiLog.level(info) << std::fixed << std::setprecision(3) <<
+ "OutputUHD:Setting freq to " << myConf.frequency <<
+ " with LO offset " << myConf.lo_offset << "...";
+
const auto tr = uhd::tune_request_t(myConf.frequency, myConf.lo_offset);
uhd::tune_result_t result = myUsrp->set_tx_freq(tr);
- etiLog.level(info) << "OutputUHD: " << std::fixed <<
- "Target RF: " << result.target_rf_freq <<
- "Actual RF: " << result.actual_rf_freq <<
- "Target DSP: " << result.target_dsp_freq <<
- "Actual DSP: " << result.actual_dsp_freq;
-
- if (result.clipped_rf_freq != result.target_rf_freq) {
- etiLog.level(warn) <<
- "OutputUHD: clipped RF frequency " << std::fixed <<
- " different from target";
- }
+ etiLog.level(debug) << "OutputUHD:" <<
+ std::fixed << std::setprecision(0) <<
+ " Target RF: " << result.target_rf_freq <<
+ " Actual RF: " << result.actual_rf_freq <<
+ " Target DSP: " << result.target_dsp_freq <<
+ " Actual DSP: " << result.actual_dsp_freq;
}
else {
//set the centre frequency
- etiLog.log(info, "OutputUHD:Setting freq to %f...\n", myConf.frequency);
+ etiLog.level(info) << std::fixed << std::setprecision(3) <<
+ "OutputUHD:Setting freq to " << myConf.frequency << "...";
myUsrp->set_tx_freq(myConf.frequency);
}
+
myConf.frequency = myUsrp->get_tx_freq();
- MDEBUG("OutputUHD:Actual frequency: %f\n", myConf.frequency);
+ etiLog.level(info) << std::fixed << std::setprecision(3) <<
+ "OutputUHD:Actual frequency: " << myConf.frequency;
myUsrp->set_tx_gain(myConf.txgain);
MDEBUG("OutputUHD:Actual TX Gain: %f ...\n", myUsrp->get_tx_gain());