aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx2.cpp
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-02-07 16:37:25 -0800
committerMartin Braun <martin.braun@ettus.com>2017-02-20 17:13:15 -0800
commit21aad77c9ca07f4271136b9241f5adb00a6bb908 (patch)
tree636ffe3ab2296e9afa661d3a12eb359224cd3254 /host/lib/usrp/dboard/db_dbsrx2.cpp
parent2b33f2bb4c01d4306fd46f78edf6e355a03e2ed7 (diff)
downloaduhd-21aad77c9ca07f4271136b9241f5adb00a6bb908.tar.gz
uhd-21aad77c9ca07f4271136b9241f5adb00a6bb908.tar.bz2
uhd-21aad77c9ca07f4271136b9241f5adb00a6bb908.zip
utils: introduce new logging API and remove msg API
Diffstat (limited to 'host/lib/usrp/dboard/db_dbsrx2.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx2.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp
index 544671d3b..1efc6efd7 100644
--- a/host/lib/usrp/dboard/db_dbsrx2.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx2.cpp
@@ -92,9 +92,9 @@ 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);
- UHD_LOGV(often) << boost::format(
+ UHD_LOGGER_DEBUG("DBSRX") << 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;
+ ) % int(start_addr+i) % int(regs_vector[1+i]) % int(start_addr) % num_bytes ;
}
//send the data
@@ -133,14 +133,14 @@ private:
if (i + start_addr >= status_addr){
_max2112_read_regs.set_reg(i + start_addr, regs_vector[i]);
/*
- UHD_LOGV(always) << boost::format(
+ UHD_LOGGER_DEBUG("DBSRX") << boost::format(
"DBSRX2: set reg 0x%02x, value 0x%04x"
- ) % int(i + start_addr) % int(_max2112_read_regs.get_reg(i + start_addr)) << std::endl;
+ ) % int(i + start_addr) % int(_max2112_read_regs.get_reg(i + start_addr));
*/
}
- UHD_LOGV(often) << boost::format(
+ UHD_LOGGER_DEBUG("DBSRX") << 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;
+ ) % int(start_addr+i) % int(regs_vector[i]) % int(start_addr) % num_bytes ;
}
}
}
@@ -155,9 +155,9 @@ private:
//mask and return lock detect
bool locked = (_max2112_read_regs.ld & _max2112_read_regs.vasa & _max2112_read_regs.vase) != 0;
- UHD_LOGV(often) << boost::format(
+ UHD_LOGGER_DEBUG("DBSRX") << boost::format(
"DBSRX2 locked: %d"
- ) % locked << std::endl;
+ ) % locked ;
return sensor_value_t("LO", locked, "locked", "unlocked");
}
@@ -189,7 +189,7 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){
// Register properties
////////////////////////////////////////////////////////////////////
this->get_rx_subtree()->create<std::string>("name")
- .set("DBSRX2");
+ .set("DBSRX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&dbsrx2::get_locked, this));
for(const std::string &name: dbsrx2_gain_ranges.keys()){
@@ -270,14 +270,14 @@ double 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
- UHD_LOGV(often)
+ UHD_LOGGER_DEBUG("DBSRX")
<< 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)
<< boost::format(" Ref Freq=%fMHz\n") % (ref_freq/1e6)
<< boost::format(" Target Freq=%fMHz\n") % (target_freq/1e6)
<< boost::format(" Actual Freq=%fMHz\n") % (_lo_freq/1e6)
- << std::endl;
+ ;
//send the registers 0x0 through 0x7
//writing register 0x4 (F divider LSB) starts the VCO auto seletion so it must be written last
@@ -304,10 +304,10 @@ static int gain_to_bbg_vga_reg(double &gain){
gain = double(reg);
- UHD_LOGV(often)
+ UHD_LOGGER_DEBUG("DBSRX")
<< boost::format("DBSRX2 BBG Gain:\n")
<< boost::format(" %f dB, bbg: %d") % gain % reg
- << std::endl;
+ ;
return reg;
}
@@ -329,10 +329,10 @@ static double gain_to_gc1_rfvga_dac(double &gain){
//calculate the voltage for the aux dac
double dac_volts = gain*slope + min_volts;
- UHD_LOGV(often)
+ UHD_LOGGER_DEBUG("DBSRX")
<< boost::format("DBSRX2 GC1 Gain:\n")
<< boost::format(" %f dB, dac_volts: %f V") % gain % dac_volts
- << std::endl;
+ ;
//the actual gain setting
gain = (dac_volts - min_volts)/slope;
@@ -369,10 +369,10 @@ double 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;
- UHD_LOGV(often)
+ UHD_LOGGER_DEBUG("DBSRX")
<< boost::format("DBSRX2 Bandwidth:\n")
<< boost::format(" %f MHz, lp: %f V") % (_bandwidth/1e6) % int(_max2112_write_regs.lp)
- << std::endl;
+ ;
this->send_reg(0x8, 0x8);