aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx2.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-05-04 12:22:21 -0700
committerJosh Blum <josh@joshknows.com>2011-05-04 14:34:49 -0700
commit0de4f165e937168693ac758239d569a2ace60325 (patch)
tree3443b1baa0cbfef13f3e881d87a25e0b58d867dd /host/lib/usrp/dboard/db_dbsrx2.cpp
parent8426a72bd66850ed1311ee8957dc5b7e4d98e301 (diff)
downloaduhd-0de4f165e937168693ac758239d569a2ace60325.tar.gz
uhd-0de4f165e937168693ac758239d569a2ace60325.tar.bz2
uhd-0de4f165e937168693ac758239d569a2ace60325.zip
usrp: replaced conditional dboard debug prints w/ UHD_LOGV(often)
Diffstat (limited to 'host/lib/usrp/dboard/db_dbsrx2.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx2.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp
index e7b42cb05..0769b3aa1 100644
--- a/host/lib/usrp/dboard/db_dbsrx2.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx2.cpp
@@ -18,6 +18,7 @@
// No RX IO Pins Used
#include "max2112_regs.hpp"
+#include <uhd/utils/log.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/algorithm.hpp>
@@ -40,8 +41,6 @@ using namespace boost::assign;
/***********************************************************************
* The DBSRX2 constants
**********************************************************************/
-static const bool dbsrx2_debug = false;
-
static const freq_range_t dbsrx2_freq_range(0.8e9, 2.4e9);
static const int dbsrx2_ref_divider = 4; // Hitachi HMC426 divider (U7)
@@ -94,7 +93,7 @@ private:
//get the register data
for(int i=0; i<num_bytes; i++){
regs_vector[1+i] = _max2112_write_regs.get_reg(start_addr+i);
- if(dbsrx2_debug) std::cerr << boost::format(
+ UHD_LOGV(often) << boost::format(
"DBSRX2: send reg 0x%02x, value 0x%04x, start_addr = 0x%04x, num_bytes %d"
) % int(start_addr+i) % int(regs_vector[1+i]) % int(start_addr) % num_bytes << std::endl;
}
@@ -140,7 +139,7 @@ private:
) % int(i + start_addr) % int(_max2112_read_regs.get_reg(i + start_addr)) << std::endl;
*/
}
- if(dbsrx2_debug) std::cerr << boost::format(
+ UHD_LOGV(often) << boost::format(
"DBSRX2: read reg 0x%02x, value 0x%04x, start_addr = 0x%04x, num_bytes %d"
) % int(start_addr+i) % int(regs_vector[i]) % int(start_addr) % num_bytes << std::endl;
}
@@ -157,7 +156,7 @@ private:
//mask and return lock detect
bool locked = (_max2112_read_regs.ld & _max2112_read_regs.vasa & _max2112_read_regs.vase) != 0;
- if(dbsrx2_debug) std::cerr << boost::format(
+ UHD_LOGV(often) << boost::format(
"DBSRX2 locked: %d"
) % locked << std::endl;
@@ -244,7 +243,7 @@ void dbsrx2::set_lo_freq(double target_freq){
_max2112_write_regs.d24 = scaler == 4 ? max2112_write_regs_t::D24_DIV4 : max2112_write_regs_t::D24_DIV2;
//debug output of calculated variables
- if (dbsrx2_debug) std::cerr
+ UHD_LOGV(often)
<< boost::format("DBSRX2 tune:\n")
<< boost::format(" R=%d, N=%f, scaler=%d, ext_div=%d\n") % R % N % scaler % ext_div
<< boost::format(" int=%d, frac=%d, d24=%d\n") % intdiv % fracdiv % int(_max2112_write_regs.d24)
@@ -275,7 +274,7 @@ static int gain_to_bbg_vga_reg(double &gain){
gain = double(reg);
- if (dbsrx2_debug) std::cerr
+ UHD_LOGV(often)
<< boost::format("DBSRX2 BBG Gain:\n")
<< boost::format(" %f dB, bbg: %d") % gain % reg
<< std::endl;
@@ -300,7 +299,7 @@ static double gain_to_gc1_rfvga_dac(double &gain){
//calculate the voltage for the aux dac
double dac_volts = gain*slope + min_volts;
- if (dbsrx2_debug) std::cerr
+ UHD_LOGV(often)
<< boost::format("DBSRX2 GC1 Gain:\n")
<< boost::format(" %f dB, dac_volts: %f V") % gain % dac_volts
<< std::endl;
@@ -335,7 +334,7 @@ void dbsrx2::set_bandwidth(double bandwidth){
_max2112_write_regs.lp = int((bandwidth/1e6 - 4)/0.29 + 12);
_bandwidth = double(4 + (_max2112_write_regs.lp - 12) * 0.29)*1e6;
- if (dbsrx2_debug) std::cerr
+ UHD_LOGV(often)
<< boost::format("DBSRX2 Bandwidth:\n")
<< boost::format(" %f MHz, lp: %f V") % (_bandwidth/1e6) % int(_max2112_write_regs.lp)
<< std::endl;