diff options
Diffstat (limited to 'host/lib/usrp/dboard')
21 files changed, 222 insertions, 222 deletions
| diff --git a/host/lib/usrp/dboard/db_basic_and_lf.cpp b/host/lib/usrp/dboard/db_basic_and_lf.cpp index 941a80ea4..a3d9fb316 100644 --- a/host/lib/usrp/dboard/db_basic_and_lf.cpp +++ b/host/lib/usrp/dboard/db_basic_and_lf.cpp @@ -19,7 +19,7 @@  #include <uhd/types/ranges.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/static.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp>  #include <uhd/usrp/dboard_base.hpp>  #include <uhd/usrp/dboard_manager.hpp>  #include <boost/assign/list_of.hpp> diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp index c27cbf58a..11cb092b8 100644 --- a/host/lib/usrp/dboard/db_cbx.cpp +++ b/host/lib/usrp/dboard/db_cbx.cpp @@ -40,7 +40,7 @@ sbx_xcvr::cbx::~cbx(void){  void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s)  { -    BOOST_FOREACH(uint32_t reg, regs) +    for(uint32_t reg:  regs)      {          self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);      } @@ -51,9 +51,9 @@ void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<u   * Tuning   **********************************************************************/  double sbx_xcvr::cbx::set_lo_freq(dboard_iface::unit_t unit, double target_freq) { -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("CBX") << boost::format(          "CBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      //clip the input      target_freq = cbx_freq_range.clip(target_freq); diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index f296820c5..80faba5d2 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -24,7 +24,7 @@  #include <uhd/utils/static.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/types/ranges.hpp>  #include <uhd/types/sensors.hpp>  #include <uhd/types/dict.hpp> @@ -98,9 +98,9 @@ private:              //get the register data              for(int i=0; i<num_bytes; i++){                  regs_vector[1+i] = _max2118_write_regs.get_reg(start_addr+i); -                UHD_LOGV(often) << boost::format( +                UHD_LOGGER_DEBUG("DBSRX") << boost::format(                      "DBSRX: 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 @@ -130,9 +130,9 @@ private:                  if (i + start_addr >= status_addr){                      _max2118_read_regs.set_reg(i + start_addr, regs_vector[i]);                  } -                UHD_LOGV(often) << boost::format( +                UHD_LOGGER_DEBUG("DBSRX") << boost::format(                      "DBSRX: 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 ;              }          }      } @@ -147,9 +147,9 @@ private:          //mask and return lock detect          bool locked = 5 >= _max2118_read_regs.adc and _max2118_read_regs.adc >= 2; -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("DBSRX") << boost::format(              "DBSRX: locked %d" -        ) % locked << std::endl; +        ) % locked ;          return sensor_value_t("LO", locked, "locked", "unlocked");      } @@ -175,7 +175,7 @@ UHD_STATIC_BLOCK(reg_dbsrx_dboard){  dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){      //warn user about incorrect DBID on USRP1, requires R193 populated      if (this->get_iface()->get_special_props().soft_clock_divider and this->get_rx_id() == 0x000D) -        UHD_MSG(warning) << boost::format( +        UHD_LOGGER_WARNING("DBSRX") << boost::format(                  "DBSRX: incorrect dbid\n"                  "Expected dbid 0x0002 and R193\n"                  "found dbid == %d\n" @@ -184,7 +184,7 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){      //warn user about incorrect DBID on non-USRP1, requires R194 populated      if (not this->get_iface()->get_special_props().soft_clock_divider and this->get_rx_id() == 0x0002) -        UHD_MSG(warning) << boost::format( +        UHD_LOGGER_WARNING("DBSRX") << boost::format(                  "DBSRX: incorrect dbid\n"                  "Expected dbid 0x000D and R194\n"                  "found dbid == %d\n" @@ -205,7 +205,7 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){          .set("DBSRX");      this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&dbsrx::get_locked, this)); -    BOOST_FOREACH(const std::string &name, dbsrx_gain_ranges.keys()){ +    for(const std::string &name:  dbsrx_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&dbsrx::set_gain, this, _1, name))              .set(dbsrx_gain_ranges[name].start()); @@ -266,7 +266,7 @@ double dbsrx::set_lo_freq(double target_freq){      //choose refclock      std::vector<double> clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX);      const double max_clock_rate = uhd::sorted(clock_rates).back(); -    BOOST_FOREACH(ref_clock, uhd::reversed(uhd::sorted(clock_rates))){ +    for(auto ref_clock:  uhd::reversed(uhd::sorted(clock_rates))){          //USRP1 feeds the DBSRX clock from a FPGA GPIO line.          //make sure that this clock does not exceed rate limit.          if (this->get_iface()->get_special_props().soft_clock_divider){ @@ -279,17 +279,17 @@ double dbsrx::set_lo_freq(double target_freq){          m = 31;          while ((ref_clock/m < 1e6 or ref_clock/m > 2.5e6) and m > 0){ m--; } -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("DBSRX") << boost::format(              "DBSRX: trying ref_clock %f and m_divider %d" -        ) % (ref_clock) % m << std::endl; +        ) % (ref_clock) % m ;          if (m >= 32) continue;          //choose R -        for(r = 0; r <= 6; r += 1) { +        for(auto r = 0; r <= 6; r += 1) {              //compute divider from setting              R = 1 << (r+1); -            UHD_LOGV(often) << boost::format("DBSRX R:%d\n") % R << std::endl; +            UHD_LOGGER_DEBUG("DBSRX") << boost::format("DBSRX R:%d\n") % R ;              //compute PFD compare frequency = ref_clock/R              pfd_freq = ref_clock / R; @@ -315,9 +315,9 @@ double dbsrx::set_lo_freq(double target_freq){      UHD_ASSERT_THROW((pfd_freq >= dbsrx_pfd_freq_range.start()) and (pfd_freq <= dbsrx_pfd_freq_range.stop()));      UHD_ASSERT_THROW((N >= 256) and (N <= 32768)); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX: choose ref_clock (current: %f, new: %f) and m_divider %d" -    ) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % ref_clock % m << std::endl; +    ) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % ref_clock % m ;      //if ref_clock or m divider changed, we need to update the filter settings      if (ref_clock != this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX) or m != _max2118_write_regs.m_divider) update_filter_settings = true; @@ -337,9 +337,9 @@ double dbsrx::set_lo_freq(double target_freq){      int scaler = actual_freq > 1125e6 ? 2 : 4;      _max2118_write_regs.div2 = scaler == 4 ? max2118_write_regs_t::DIV2_DIV4 : max2118_write_regs_t::DIV2_DIV2; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX: scaler %d, actual_freq %f MHz, register bit: %d" -    ) % scaler % (actual_freq/1e6) % int(_max2118_write_regs.div2) << std::endl; +    ) % scaler % (actual_freq/1e6) % int(_max2118_write_regs.div2) ;      //compute vco frequency and select vco      double vco_freq = actual_freq * scaler; @@ -366,9 +366,9 @@ double dbsrx::set_lo_freq(double target_freq){      //check vtune for lock condition      read_reg(0x0, 0x0); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX: initial guess for vco %d, vtune adc %d" -    ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) << std::endl; +    ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) ;      //if we are out of lock for chosen vco, change vco      while ((_max2118_read_regs.adc == 0) or (_max2118_read_regs.adc == 7)){ @@ -376,7 +376,7 @@ double dbsrx::set_lo_freq(double target_freq){          //vtune is too low, try lower frequency vco          if (_max2118_read_regs.adc == 0){              if (_max2118_write_regs.osc_band == 0){ -                UHD_MSG(warning) << boost::format( +                UHD_LOGGER_WARNING("DBSRX") << boost::format(                          "DBSRX: Tuning exceeded vco range, _max2118_write_regs.osc_band == %d\n"                          ) % int(_max2118_write_regs.osc_band);                  UHD_ASSERT_THROW(_max2118_read_regs.adc != 0); //just to cause a throw @@ -388,7 +388,7 @@ double dbsrx::set_lo_freq(double target_freq){          //vtune is too high, try higher frequency vco          if (_max2118_read_regs.adc == 7){              if (_max2118_write_regs.osc_band == 7){ -                UHD_MSG(warning) << boost::format( +                UHD_LOGGER_WARNING("DBSRX") << boost::format(                          "DBSRX: Tuning exceeded vco range, _max2118_write_regs.osc_band == %d\n"                          ) % int(_max2118_write_regs.osc_band);                  UHD_ASSERT_THROW(_max2118_read_regs.adc != 7); //just to cause a throw @@ -397,9 +397,9 @@ double dbsrx::set_lo_freq(double target_freq){              _max2118_write_regs.osc_band += 1;          } -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("DBSRX") << boost::format(              "DBSRX: trying vco %d, vtune adc %d" -        ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) << std::endl; +        ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) ;          //update vco selection and check vtune          send_reg(0x2, 0x2); @@ -409,9 +409,9 @@ double dbsrx::set_lo_freq(double target_freq){          boost::this_thread::sleep(boost::posix_time::milliseconds(10));      } -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX: final vco %d, vtune adc %d" -    ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) << std::endl; +    ) % int(_max2118_write_regs.osc_band) % int(_max2118_read_regs.adc) ;      //select charge pump bias current      if (_max2118_read_regs.adc <= 2) _max2118_write_regs.cp_current = max2118_write_regs_t::CP_CURRENT_I_CP_100UA; @@ -425,7 +425,7 @@ double dbsrx::set_lo_freq(double target_freq){      _lo_freq = this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX) / std::pow(2.0,(1 + _max2118_write_regs.r_divider)) * _max2118_write_regs.get_n_divider();      //debug output of calculated variables -    UHD_LOGV(often) +    UHD_LOGGER_DEBUG("DBSRX")          << boost::format("DBSRX tune:\n")          << boost::format("    VCO=%d, CP=%d, PFD Freq=%fMHz\n") % int(_max2118_write_regs.osc_band) % _max2118_write_regs.cp_current % (pfd_freq/1e6)          << boost::format("    R=%d, N=%f, scaler=%d, div2=%d\n") % R % N % scaler % int(_max2118_write_regs.div2) @@ -433,7 +433,7 @@ double dbsrx::set_lo_freq(double target_freq){          << boost::format("    Target Freq=%fMHz\n") % (target_freq/1e6)          << boost::format("    Actual Freq=%fMHz\n") % (_lo_freq/1e6)          << boost::format("    VCO    Freq=%fMHz\n") % (vco_freq/1e6) -        << std::endl; +        ;      if (update_filter_settings) set_bandwidth(_bandwidth);      get_locked(); @@ -463,9 +463,9 @@ static int gain_to_gc2_vga_reg(double &gain){          gain = double(boost::math::iround(gain));      } -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX GC2 Gain: %f dB, reg: %d" -    ) % gain % reg << std::endl; +    ) % gain % reg ;      return reg;  } @@ -487,9 +487,9 @@ 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) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX GC1 Gain: %f dB, dac_volts: %f V" -    ) % gain % dac_volts << std::endl; +    ) % gain % dac_volts ;      //the actual gain setting      gain = (dac_volts - min_volts)/slope; @@ -533,9 +533,9 @@ double dbsrx::set_bandwidth(double bandwidth){      //determine actual bandwidth      _bandwidth = double((ref_clock/(_max2118_write_regs.m_divider))*(4+0.145*_max2118_write_regs.f_dac)); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("DBSRX") << boost::format(          "DBSRX Filter Bandwidth: %f MHz, m: %d, f_dac: %d\n" -    ) % (_bandwidth/1e6) % int(_max2118_write_regs.m_divider) % int(_max2118_write_regs.f_dac) << std::endl; +    ) % (_bandwidth/1e6) % int(_max2118_write_regs.m_divider) % int(_max2118_write_regs.f_dac) ;      this->send_reg(0x3, 0x4); diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 21b0fd02d..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,10 +189,10 @@ 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)); -    BOOST_FOREACH(const std::string &name, dbsrx2_gain_ranges.keys()){ +    for(const std::string &name:  dbsrx2_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&dbsrx2::set_gain, this, _1, name))              .set(dbsrx2_gain_ranges[name].start()); @@ -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); diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp index 9bbd73425..0a2729320 100644 --- a/host/lib/usrp/dboard/db_rfx.cpp +++ b/host/lib/usrp/dboard/db_rfx.cpp @@ -40,7 +40,7 @@  #include <uhd/utils/log.hpp>  #include <uhd/utils/static.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/usrp/dboard_id.hpp>  #include <uhd/usrp/dboard_base.hpp>  #include <uhd/usrp/dboard_manager.hpp> @@ -184,7 +184,7 @@ rfx_xcvr::rfx_xcvr(      this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX)); -    BOOST_FOREACH(const std::string &name, _rx_gain_ranges.keys()){ +    for(const std::string &name:  _rx_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&rfx_xcvr::set_rx_gain, this, _1, name))              .set(_rx_gain_ranges[name].start()); @@ -339,9 +339,9 @@ double rfx_xcvr::set_lo_freq(      dboard_iface::unit_t unit,      double target_freq  ){ -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("RFX") << boost::format(          "RFX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      //clip the input      target_freq = _freq_range.clip(target_freq); @@ -379,9 +379,9 @@ double rfx_xcvr::set_lo_freq(       * fvco*R/fref = P*B + A = N       */      for(R = 2; R <= 32; R+=2){ -        BOOST_FOREACH(BS, bandsel_to_enum.keys()){ +        for(auto BS:  bandsel_to_enum.keys()){              if (ref_freq/R/BS > 1e6) continue; //constraint on band select clock -            BOOST_FOREACH(P, prescaler_to_enum.keys()){ +            for(auto P:  prescaler_to_enum.keys()){                  //calculate B and A from N                  double N = target_freq*R/ref_freq;                  B = int(std::floor(N/P)); @@ -396,9 +396,9 @@ double rfx_xcvr::set_lo_freq(          }      } done_loop: -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("RFX") << boost::format(          "RFX tune: R=%d, BS=%d, P=%d, B=%d, A=%d, DIV2=%d" -    ) % R % BS % P % B % A % int(_div2[unit] && (!is_rx_rfx400)) << std::endl; +    ) % R % BS % P % B % A % int(_div2[unit] && (!is_rx_rfx400)) ;      //load the register values      adf4360_regs_t regs; @@ -433,7 +433,7 @@ double rfx_xcvr::set_lo_freq(          (adf4360_regs_t::ADDR_CONTROL)          (adf4360_regs_t::ADDR_NCOUNTER)      ; -    BOOST_FOREACH(adf4360_regs_t::addr_t addr, addrs){ +    for(adf4360_regs_t::addr_t addr:  addrs){          this->get_iface()->write_spi(              unit, spi_config_t::EDGE_RISE,              regs.get_reg(addr), 24 @@ -442,8 +442,8 @@ double rfx_xcvr::set_lo_freq(      //return the actual frequency      if (_div2[unit]) actual_freq /= 2; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("RFX") << boost::format(          "RFX tune: actual frequency %f MHz" -    ) % (actual_freq/1e6) << std::endl; +    ) % (actual_freq/1e6) ;      return actual_freq;  } diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp index efc84d7e6..fccad7cf7 100644 --- a/host/lib/usrp/dboard/db_sbx_common.cpp +++ b/host/lib/usrp/dboard/db_sbx_common.cpp @@ -53,9 +53,9 @@ static int rx_pga0_gain_to_iobits(double &gain){      int attn_code = int(floor(attn*2));      int iobits = ((~attn_code) << RX_ATTN_SHIFT) & RX_ATTN_MASK; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("SBX") << boost::format(          "SBX RX Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x" -    ) % attn % attn_code % (iobits & RX_ATTN_MASK) % RX_ATTN_MASK << std::endl; +    ) % attn % attn_code % (iobits & RX_ATTN_MASK) % RX_ATTN_MASK ;      //the actual gain setting      gain = sbx_rx_gain_ranges["PGA0"].stop() - double(attn_code)/2; @@ -74,9 +74,9 @@ static int tx_pga0_gain_to_iobits(double &gain){      int attn_code = int(floor(attn*2));      int iobits = ((~attn_code) << TX_ATTN_SHIFT) & TX_ATTN_MASK; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("SBX") << boost::format(          "SBX TX Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x" -    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK << std::endl; +    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK ;      //the actual gain setting      gain = sbx_tx_gain_ranges["PGA0"].stop() - double(attn_code)/2; @@ -160,7 +160,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){      this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_RX)); -    BOOST_FOREACH(const std::string &name, sbx_rx_gain_ranges.keys()){ +    for(const std::string &name:  sbx_rx_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&sbx_xcvr::set_rx_gain, this, _1, name))              .set(sbx_rx_gain_ranges[name].start()); @@ -201,7 +201,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){      this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_TX)); -    BOOST_FOREACH(const std::string &name, sbx_tx_gain_ranges.keys()){ +    for(const std::string &name:  sbx_tx_gain_ranges.keys()){          this->get_tx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&sbx_xcvr::set_tx_gain, this, _1, name))              .set(sbx_tx_gain_ranges[name].start()); @@ -240,9 +240,9 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){      //Initialize ATR registers after direction and pin ctrl configuration      update_atr(); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("SBX") << boost::format(          "SBX GPIO Direction: RX: 0x%08x, TX: 0x%08x" -    ) % RXIO_MASK % TXIO_MASK << std::endl; +    ) % RXIO_MASK % TXIO_MASK ;  }  sbx_xcvr::~sbx_xcvr(void){ diff --git a/host/lib/usrp/dboard/db_sbx_common.hpp b/host/lib/usrp/dboard/db_sbx_common.hpp index ad64e2267..0e4dc5ace 100644 --- a/host/lib/usrp/dboard/db_sbx_common.hpp +++ b/host/lib/usrp/dboard/db_sbx_common.hpp @@ -84,7 +84,7 @@  #include <uhd/utils/log.hpp>  #include <uhd/utils/static.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/usrp/dboard_base.hpp>  #include <uhd/usrp/dboard_manager.hpp>  #include <boost/assign/list_of.hpp> diff --git a/host/lib/usrp/dboard/db_sbx_version3.cpp b/host/lib/usrp/dboard/db_sbx_version3.cpp index bb2ba6bd6..9f762a7f2 100644 --- a/host/lib/usrp/dboard/db_sbx_version3.cpp +++ b/host/lib/usrp/dboard/db_sbx_version3.cpp @@ -40,7 +40,7 @@ sbx_xcvr::sbx_version3::~sbx_version3(void){  void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s)  { -    BOOST_FOREACH(uint32_t reg, regs) +    for(uint32_t reg:  regs)      {          self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);      } @@ -50,9 +50,9 @@ void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std:   * Tuning   **********************************************************************/  double sbx_xcvr::sbx_version3::set_lo_freq(dboard_iface::unit_t unit, double target_freq) { -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("SBX") << boost::format(          "SBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      /*       * If the user sets 'mode_n=integer' in the tuning args, the user wishes to diff --git a/host/lib/usrp/dboard/db_sbx_version4.cpp b/host/lib/usrp/dboard/db_sbx_version4.cpp index e5b6e081c..effe0b5eb 100644 --- a/host/lib/usrp/dboard/db_sbx_version4.cpp +++ b/host/lib/usrp/dboard/db_sbx_version4.cpp @@ -41,7 +41,7 @@ sbx_xcvr::sbx_version4::~sbx_version4(void){  void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s)  { -    BOOST_FOREACH(uint32_t reg, regs) +    for(uint32_t reg:  regs)      {          self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);      } @@ -52,9 +52,9 @@ void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std:   * Tuning   **********************************************************************/  double sbx_xcvr::sbx_version4::set_lo_freq(dboard_iface::unit_t unit, double target_freq) { -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("SBX") << boost::format(          "SBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      /*       * If the user sets 'mode_n=integer' in the tuning args, the user wishes to diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 5c0600c61..41188ff77 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -31,7 +31,7 @@  #include <uhd/utils/static.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/types/ranges.hpp>  #include <uhd/types/sensors.hpp>  #include <uhd/types/dict.hpp> @@ -107,7 +107,7 @@ static const boost::array<double, 17> tvrx_gains_volts =  static uhd::dict<std::string, gain_range_t> get_tvrx_gain_ranges(void) {      double rfmax = 0.0, rfmin = FLT_MAX; -    BOOST_FOREACH(const std::string range, tvrx_rf_gains_db.keys()) { +    for(const std::string range:  tvrx_rf_gains_db.keys()) {          double my_max = tvrx_rf_gains_db[range].back(); //we're assuming it's monotonic          double my_min = tvrx_rf_gains_db[range].front(); //if it's not this is wrong wrong wrong          if(my_max > rfmax) rfmax = my_max; @@ -153,9 +153,9 @@ private:          //get the register data          for(int i=0; i<4; i++){              regs_vector[i] = _tuner_4937di5_regs.get_reg(i); -            UHD_LOGV(often) << boost::format( +            UHD_LOGGER_DEBUG("TVRX") << boost::format(                  "tvrx: send reg 0x%02x, value 0x%04x" -            ) % int(i) % int(regs_vector[i]) << std::endl; +            ) % int(i) % int(regs_vector[i]) ;          }          //send the data @@ -188,7 +188,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){      this->get_rx_subtree()->create<std::string>("name")          .set("TVRX");      this->get_rx_subtree()->create<int>("sensors"); //phony property so this dir exists -    BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){ +    for(const std::string &name:  get_tvrx_gain_ranges().keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&tvrx::set_gain, this, _1, name));          this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range") @@ -232,7 +232,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){      this->get_rx_subtree()->access<double>("freq/value").set(tvrx_freq_range.start());      //set default gains -    BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){ +    for(const std::string &name:  get_tvrx_gain_ranges().keys()){          this->get_rx_subtree()->access<double>("gains/"+name+"/value")              .set(get_tvrx_gain_ranges()[name].start());      } @@ -247,9 +247,9 @@ tvrx::~tvrx(void){   */  static std::string get_band(double freq) { -    BOOST_FOREACH(const std::string &band, tvrx_freq_ranges.keys()) { +    for(const std::string &band:  tvrx_freq_ranges.keys()) {          if(freq >= tvrx_freq_ranges[band].start() && freq <= tvrx_freq_ranges[band].stop()){ -            UHD_LOGV(often) << "Band: " << band << std::endl; +            UHD_LOGGER_DEBUG("TVRX") << "Band: " << band ;              return band;          }      } @@ -291,7 +291,7 @@ static double gain_interp(double gain, const boost::array<double, 17>& db_vector      //use the volts per dB slope to find the final interpolated voltage      volts = volts_vector[gain_step] + (slope * (gain - db_vector[gain_step])); -    UHD_LOGV(often) << "Gain interp: gain: " << gain << ", gain_step: " << int(gain_step) << ", slope: " << slope << ", volts: " << volts << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << "Gain interp: gain: " << gain << ", gain_step: " << int(gain_step) << ", slope: " << slope << ", volts: " << volts ;      return volts;  } @@ -317,9 +317,9 @@ static double rf_gain_to_voltage(double gain, double lo_freq){      dac_volts = uhd::clip<double>(dac_volts, 0.0, 3.3); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "tvrx RF AGC gain: %f dB, dac_volts: %f V" -    ) % gain % dac_volts << std::endl; +    ) % gain % dac_volts ;      return dac_volts;  } @@ -340,9 +340,9 @@ static double if_gain_to_voltage(double gain){      dac_volts = uhd::clip<double>(dac_volts, 0.0, 3.3); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "tvrx IF AGC gain: %f dB, dac_volts: %f V" -    ) % gain % dac_volts << std::endl; +    ) % gain % dac_volts ;      return dac_volts;  } @@ -396,7 +396,7 @@ double tvrx::set_freq(double freq) {      //not FAR off, but we do this to be consistent      if(prev_band != new_band) set_gain(_gains["RF"], "RF"); -    UHD_LOGV(often) << boost::format("set_freq: target LO: %f f_ref: %f divisor: %i actual LO: %f") % target_lo_freq % f_ref % divisor % actual_lo_freq << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format("set_freq: target LO: %f f_ref: %f divisor: %i actual LO: %f") % target_lo_freq % f_ref % divisor % actual_lo_freq ;      _lo_freq = actual_lo_freq; //for rx props diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp index 1bac81153..6be3684d7 100644 --- a/host/lib/usrp/dboard/db_tvrx2.cpp +++ b/host/lib/usrp/dboard/db_tvrx2.cpp @@ -52,7 +52,7 @@  #include "tda18272hnm_regs.hpp"  #include <uhd/utils/static.hpp>  #include <uhd/utils/log.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/utils/safe_call.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> @@ -803,9 +803,9 @@ private:          //return irq status          bool irq = _tda18272hnm_regs.irq_status == tda18272hnm_regs_t::IRQ_STATUS_SET; -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): IRQ %d" -        ) % (get_subdev_name()) % irq << std::endl; +        ) % (get_subdev_name()) % irq ;          return irq;      } @@ -821,9 +821,9 @@ private:          //return POR state          bool por = _tda18272hnm_regs.por == tda18272hnm_regs_t::POR_RESET; -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): POR %d" -        ) % (get_subdev_name()) % int(_tda18272hnm_regs.por) << std::endl; +        ) % (get_subdev_name()) % int(_tda18272hnm_regs.por) ;          return por;      } @@ -838,9 +838,9 @@ private:          //return lock detect          bool locked = _tda18272hnm_regs.lo_lock == tda18272hnm_regs_t::LO_LOCK_LOCKED; -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): locked %d" -        ) % (get_subdev_name()) % locked << std::endl; +        ) % (get_subdev_name()) % locked ;          return sensor_value_t("LO", locked, "locked", "unlocked");      } @@ -881,9 +881,9 @@ private:          //read temp in degC          read_reg(0x3, 0x3); -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): Temperature %f C" -        ) % (get_subdev_name()) % (double(_tda18272hnm_regs.tm_d)) << std::endl; +        ) % (get_subdev_name()) % (double(_tda18272hnm_regs.tm_d)) ;          //Disable Temperature reading          _tda18272hnm_regs.tm_on = tda18272hnm_regs_t::TM_ON_SENSOR_OFF; @@ -962,7 +962,7 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){          .set_publisher(boost::bind(&tvrx2::get_rssi, this));      this->get_rx_subtree()->create<sensor_value_t>("sensors/temperature")          .set_publisher(boost::bind(&tvrx2::get_temp, this)); -    BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){ +    for(const std::string &name:  tvrx2_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&tvrx2::set_gain, this, _1, name));          this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range") @@ -999,42 +999,42 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){      if (ref_clock == 64.0e6) {          this->get_iface()->set_gpio_out(dboard_iface::UNIT_RX, REFCLOCK_DIV4); -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): Dividing Refclock by 4" -        ) % (get_subdev_name()) << std::endl; +        ) % (get_subdev_name()) ;          _freq_scalar = (4*16.0e6)/(this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX));      } else if (ref_clock == 100e6) {          this->get_iface()->set_gpio_out(dboard_iface::UNIT_RX, REFCLOCK_DIV6); -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): Dividing Refclock by 6" -        ) % (get_subdev_name()) << std::endl; +        ) % (get_subdev_name()) ;          _freq_scalar = (6*16.0e6)/this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX);      } else if (ref_clock == 200e6)  { -        UHD_MSG(warning) << boost::format("ref_clock was 200e6, setting ref_clock divider for 100e6.") << std::endl; +        UHD_LOGGER_WARNING("TVRX") << boost::format("ref_clock was 200e6, setting ref_clock divider for 100e6.") ;          this->get_iface()->set_clock_rate(dboard_iface::UNIT_RX, 100e6);          this->get_iface()->set_gpio_out(dboard_iface::UNIT_RX, REFCLOCK_DIV6); -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("TVRX") << boost::format(              "TVRX2 (%s): Dividing Refclock by 6" -        ) % (get_subdev_name()) << std::endl; +        ) % (get_subdev_name()) ;          _freq_scalar = (6*16.0e6)/this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX);      } else {          this->get_iface()->set_gpio_out(dboard_iface::UNIT_RX, REFCLOCK_DIV6); -        UHD_MSG(warning) << boost::format("Unsupported ref_clock %0.2f, valid options 64e6, 100e6, 200e6") % ref_clock << std::endl; +        UHD_LOGGER_WARNING("TVRX") << boost::format("Unsupported ref_clock %0.2f, valid options 64e6, 100e6, 200e6") % ref_clock ;          _freq_scalar = 1.0;      }      //enable only the clocks we need      this->get_iface()->set_clock_enabled(dboard_iface::UNIT_RX, true); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "TVRX2 (%s): Refclock %f Hz, scalar = %f" -    ) % (get_subdev_name()) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % _freq_scalar << std::endl; +    ) % (get_subdev_name()) % (this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX)) % _freq_scalar ;      _tda18272hnm_regs.irq_polarity = tda18272hnm_regs_t::IRQ_POLARITY_RAISED_VCC;      _tda18272hnm_regs.irq_clear = tda18272hnm_regs_t::IRQ_CLEAR_TRUE; @@ -1066,7 +1066,7 @@ bool tvrx2::set_enabled(bool enable){          test_rf_filter_robustness(); -        BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){ +        for(const std::string &name:  tvrx2_gain_ranges.keys()){              this->get_rx_subtree()->access<double>("gains/"+name+"/value")                  .set(tvrx2_gain_ranges[name].start());          } @@ -1092,9 +1092,9 @@ bool tvrx2::set_enabled(bool enable){  }  tvrx2::~tvrx2(void){ -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "TVRX2 (%s): Called Destructor" -    ) % (get_subdev_name()) << std::endl; +    ) % (get_subdev_name()) ;      UHD_SAFE_CALL(if (_enabled) set_enabled(false);)  } @@ -1134,9 +1134,9 @@ void tvrx2::send_reg(uint8_t start_reg, uint8_t stop_reg){          //get the register data          for(int i=0; i<num_bytes; i++){              regs_vector[1+i] = _tda18272hnm_regs.get_reg(start_addr+i); -            UHD_LOGV(often) << boost::format( +            UHD_LOGGER_DEBUG("TVRX") << boost::format(                  "TVRX2 (%s, 0x%02x): send reg 0x%02x, value 0x%04x, start_addr = 0x%04x, num_bytes %d" -            ) % (get_subdev_name()) % int(tvrx2_sd_name_to_i2c_addr[get_subdev_name()]) % int(start_addr+i) % int(regs_vector[1+i]) % int(start_addr) % num_bytes << std::endl; +            ) % (get_subdev_name()) % int(tvrx2_sd_name_to_i2c_addr[get_subdev_name()]) % int(start_addr+i) % int(regs_vector[1+i]) % int(start_addr) % num_bytes ;          }          //send the data @@ -1177,9 +1177,9 @@ void tvrx2::read_reg(uint8_t start_reg, uint8_t stop_reg){              if (i + start_addr >= status_addr){                  _tda18272hnm_regs.set_reg(i + start_addr, regs_vector[i]);              } -            UHD_LOGV(often) << boost::format( +            UHD_LOGGER_DEBUG("TVRX") << boost::format(                  "TVRX2 (%s, 0x%02x): read reg 0x%02x, value 0x%04x, start_addr = 0x%04x, num_bytes %d" -            ) % (get_subdev_name()) % int(tvrx2_sd_name_to_i2c_addr[get_subdev_name()]) % int(start_addr+i) % int(regs_vector[i]) % int(start_addr) % num_bytes << std::endl; +            ) % (get_subdev_name()) % int(tvrx2_sd_name_to_i2c_addr[get_subdev_name()]) % int(start_addr+i) % int(regs_vector[i]) % int(start_addr) % num_bytes ;          }      }  } @@ -1271,14 +1271,14 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void)      // Loop through rfcal_log_* registers, initialize _rfcal_results -    BOOST_FOREACH(const uint32_t &result, result_to_cal_regs.keys()) +    for(const uint32_t &result:  result_to_cal_regs.keys())          _rfcal_results[result].delta_c = result_to_cal_regs[result] > 63 ? result_to_cal_regs[result] - 128 : result_to_cal_regs[result];      /* read byte 0x26-0x2B */      read_reg(0x26, 0x2B);      // Loop through rfcal_byte_* registers, initialize _rfcal_coeffs -    BOOST_FOREACH(const uint32_t &subband, _rfcal_coeffs.keys()) +    for(const uint32_t &subband:  _rfcal_coeffs.keys())      {          freq_range_t subband_freqs; @@ -1374,7 +1374,7 @@ void tvrx2::tvrx2_tda18272_tune_rf_filter(uint32_t uRF)      _tda18272hnm_regs.gain_taper = gain_taper;      _tda18272hnm_regs.rf_filter_band = RFBand; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "\nTVRX2 (%s): Software Calibration:\n"          "\tRF Filter Bypass = %d\n"          "\tRF Filter Cap    = %d\n" @@ -1385,14 +1385,14 @@ void tvrx2::tvrx2_tda18272_tune_rf_filter(uint32_t uRF)          % int(_tda18272hnm_regs.rf_filter_cap)          % int(_tda18272hnm_regs.rf_filter_band)           % int(_tda18272hnm_regs.gain_taper) -        << std::endl; +        ;      send_reg(0x2c, 0x2f);  }  void tvrx2::soft_calibration(void){ -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Software Calibration: Initialize Tuner, Calibrate and Standby\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Software Calibration: Initialize Tuner, Calibrate and Standby\n") % (get_subdev_name()) ;      _tda18272hnm_regs.sm = tda18272hnm_regs_t::SM_NORMAL;      _tda18272hnm_regs.sm_lna = tda18272hnm_regs_t::SM_LNA_ON; @@ -1473,7 +1473,7 @@ void tvrx2::test_rf_filter_robustness(void){          ("UHFHigh_1", 0x43)      ; -    BOOST_FOREACH(const std::string &name, filter_cal_regs.keys()){ +    for(const std::string &name:  filter_cal_regs.keys()){          uint8_t cal_result = _tda18272hnm_regs.get_reg(filter_cal_regs[name]);          if (cal_result & 0x80) {              _filter_ratings.set(name, "E"); @@ -1515,12 +1515,12 @@ void tvrx2::test_rf_filter_robustness(void){      }      std::stringstream robustness_message; -    robustness_message << boost::format("TVRX2 (%s): RF Filter Robustness Results:") % (get_subdev_name()) << std::endl; -    BOOST_FOREACH(const std::string &name, uhd::sorted(_filter_ratings.keys())){ -        robustness_message << boost::format("\t%s:\tMargin = %0.2f,\tRobustness = %c") % name % (_filter_margins[name]) % (_filter_ratings[name]) << std::endl; +    robustness_message << boost::format("TVRX2 (%s): RF Filter Robustness Results:") % (get_subdev_name()); +    for(const std::string &name:  uhd::sorted(_filter_ratings.keys())){ +        robustness_message << boost::format("\t%s:\tMargin = %0.2f,\tRobustness = %c") % name % (_filter_margins[name]) % (_filter_ratings[name]);      } -    UHD_LOGV(often) << robustness_message.str(); +    UHD_LOGGER_DEBUG("TVRX") << robustness_message.str();  }  /*********************************************************************** @@ -1528,8 +1528,8 @@ void tvrx2::test_rf_filter_robustness(void){   **********************************************************************/  void tvrx2::transition_0(void){      //Transition 0: Initialize Tuner and place in standby -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Transition 0: Initialize Tuner, Calibrate and Standby\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Transition 0: Initialize Tuner, Calibrate and Standby\n") % (get_subdev_name()) ;      //Check for Power-On Reset, if reset, initialze tuner      if (get_power_reset()) { @@ -1582,8 +1582,8 @@ void tvrx2::transition_0(void){  void tvrx2::transition_1(void){      //Transition 1: Select TV Standard -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Transition 1: Select TV Standard\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Transition 1: Select TV Standard\n") % (get_subdev_name()) ;      //send magic xtal_cal_dac setting      send_reg(0x65, 0x65); @@ -1613,8 +1613,8 @@ void tvrx2::transition_1(void){  void tvrx2::transition_2(int rf_freq){      //Transition 2: Select RF Frequency after changing TV Standard -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Transition 2: Select RF Frequency after changing TV Standard\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Transition 2: Select RF Frequency after changing TV Standard\n") % (get_subdev_name()) ;      //send magic xtal_cal_dac setting      send_reg(0x65, 0x65); @@ -1651,8 +1651,8 @@ void tvrx2::transition_2(int rf_freq){  void tvrx2::transition_3(void){      //Transition 3: Standby Mode -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Transition 3: Standby Mode\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Transition 3: Standby Mode\n") % (get_subdev_name()) ;      //send magic xtal_cal_dac setting      send_reg(0x65, 0x65); @@ -1670,8 +1670,8 @@ void tvrx2::transition_3(void){  void tvrx2::transition_4(int rf_freq){      //Transition 4: Change RF Frequency without changing TV Standard -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Transition 4: Change RF Frequency without changing TV Standard\n") % (get_subdev_name()) << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Transition 4: Change RF Frequency without changing TV Standard\n") % (get_subdev_name()) ;      //send magic xtal_cal_dac setting      send_reg(0x65, 0x65); @@ -1699,8 +1699,8 @@ void tvrx2::wait_irq(void){      int timeout = 20; //irq waiting timeout in milliseconds      //int irq = (this->get_iface()->read_gpio(dboard_iface::UNIT_RX) & int(tvrx2_sd_name_to_irq_io[get_subdev_name()]));      bool irq = get_irq(); -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Waiting on IRQ, subdev = %d, mask = 0x%x, Status: 0x%x\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Waiting on IRQ, subdev = %d, mask = 0x%x, Status: 0x%x\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq ;      while (not irq and timeout > 0) {          //irq = (this->get_iface()->read_gpio(dboard_iface::UNIT_RX) & tvrx2_sd_name_to_irq_io[get_subdev_name()]); @@ -1709,13 +1709,13 @@ void tvrx2::wait_irq(void){          timeout -= 1;      } -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): IRQ Raised, subdev = %d, mask = 0x%x, Status: 0x%x, Timeout: %d\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq % timeout << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): IRQ Raised, subdev = %d, mask = 0x%x, Status: 0x%x, Timeout: %d\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq % timeout ;      read_reg(0xA, 0xB);      //UHD_ASSERT_THROW(timeout > 0); -    if(timeout <= 0) UHD_MSG(warning) << boost::format( -        "\nTVRX2 (%s): Timeout waiting on IRQ\n") % (get_subdev_name()) << std::endl; +    if(timeout <= 0) UHD_LOGGER_WARNING("TVRX") << boost::format( +        "\nTVRX2 (%s): Timeout waiting on IRQ\n") % (get_subdev_name()) ;      _tda18272hnm_regs.irq_clear = tda18272hnm_regs_t::IRQ_CLEAR_TRUE;      send_reg(0xA, 0xA); @@ -1723,8 +1723,8 @@ void tvrx2::wait_irq(void){      irq = (this->get_iface()->read_gpio(dboard_iface::UNIT_RX) & tvrx2_sd_name_to_irq_io[get_subdev_name()]) > 0; -    UHD_LOGV(often) << boost::format( -        "\nTVRX2 (%s): Cleared IRQ, subdev = %d, mask = 0x%x, Status: 0x%x\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq << std::endl; +    UHD_LOGGER_DEBUG("TVRX") << boost::format( +        "\nTVRX2 (%s): Cleared IRQ, subdev = %d, mask = 0x%x, Status: 0x%x\n") % (get_subdev_name()) % get_subdev_name() % (int(tvrx2_sd_name_to_irq_io[get_subdev_name()])) % irq ;  } @@ -1748,20 +1748,20 @@ double tvrx2::set_lo_freq(double target_freq){      _lo_freq = get_scaled_rf_freq() + get_scaled_if_freq(); // - _bandwidth/2;      //debug output of calculated variables -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "\nTVRX2 (%s): LO Frequency\n"          "\tRequested: \t%f\n"          "\tComputed: \t%f\n"          "\tReadback: \t%f\n" -        "\tIF Frequency: \t%f\n") % (get_subdev_name()) % target_freq % double(int(target_freq/1e3)*1e3) % get_scaled_rf_freq() % get_scaled_if_freq() << std::endl; +        "\tIF Frequency: \t%f\n") % (get_subdev_name()) % target_freq % double(int(target_freq/1e3)*1e3) % get_scaled_rf_freq() % get_scaled_if_freq() ;      get_locked();      test_rf_filter_robustness(); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "\nTVRX2 (%s): RSSI = %f dBm\n" -    ) % (get_subdev_name()) % (get_rssi().to_real()) << std::endl; +    ) % (get_subdev_name()) % (get_rssi().to_real()) ;      return _lo_freq;  } @@ -1783,9 +1783,9 @@ static double gain_to_if_gain_dac(double &gain){      //calculate the voltage for the aux dac      double dac_volts = gain*slope + min_volts; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "TVRX2 IF Gain: %f dB, dac_volts: %f V" -    ) % gain % dac_volts << std::endl; +    ) % gain % dac_volts ;      //the actual gain setting      gain = (dac_volts - min_volts)/slope; @@ -1847,9 +1847,9 @@ double tvrx2::set_bandwidth(double bandwidth){      //update register      send_reg(0x13, 0x13); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("TVRX") << boost::format(          "TVRX2 (%s) Bandwidth (lp_fc): %f Hz, reg: %d" -    ) % (get_subdev_name()) % _bandwidth % (int(_tda18272hnm_regs.lp_fc)) << std::endl; +    ) % (get_subdev_name()) % _bandwidth % (int(_tda18272hnm_regs.lp_fc)) ;      return _bandwidth;  } diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp index 2af6bc4ff..91b38f90c 100644 --- a/host/lib/usrp/dboard/db_twinrx.cpp +++ b/host/lib/usrp/dboard/db_twinrx.cpp @@ -265,7 +265,7 @@ public:          // Add workers to expert          //---------------------------------------------------------          //Channel (front-end) specific -        BOOST_FOREACH(const std::string& fe, _fe_names) { +        for(const std::string& fe:  _fe_names) {              expert_factory::add_worker_node<twinrx_freq_path_expert>(_expert, _expert->node_retriever(), fe);              expert_factory::add_worker_node<twinrx_freq_coercion_expert>(_expert, _expert->node_retriever(), fe);              expert_factory::add_worker_node<twinrx_chan_gain_expert>(_expert, _expert->node_retriever(), fe); diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index 3dd0b1c84..b52234947 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -27,7 +27,7 @@  #include <uhd/usrp/dboard_manager.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/log.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/utils/static.hpp>  #include <uhd/utils/safe_call.hpp>  #include <boost/assign/list_of.hpp> @@ -300,7 +300,7 @@ public:              {                  std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_RX);                  double highest_rate = 0.0; -                BOOST_FOREACH(double rate, rates) +                for(double rate:  rates)                  {                      if (rate <= pfd_freq_max and rate > highest_rate)                          highest_rate = rate; @@ -312,7 +312,7 @@ public:              {                  std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_TX);                  double highest_rate = 0.0; -                BOOST_FOREACH(double rate, rates) +                for(double rate:  rates)                  {                      if (rate <= pfd_freq_max and rate > highest_rate)                          highest_rate = rate; @@ -370,7 +370,7 @@ public:              _rxlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));              _rxlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));              std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2); -            BOOST_FOREACH(max287x_iface::sptr lo, los) +            for(max287x_iface::sptr lo:  los)              {                  lo->set_auto_retune(false);                  lo->set_muxout_mode(max287x_iface::MUXOUT_DLD); @@ -384,7 +384,7 @@ public:              _rxlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));              _rxlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));              std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2); -            BOOST_FOREACH(max287x_iface::sptr lo, los) +            for(max287x_iface::sptr lo:  los)              {                  lo->set_auto_retune(false);                  //lo->set_cycle_slip_mode(true);  // tried it - caused longer lock times @@ -547,7 +547,7 @@ private:      {          boost::mutex::scoped_lock lock(_spi_mutex);          ROUTE_SPI(_iface, dest); -        BOOST_FOREACH(uint32_t value, values) +        for(uint32_t value:  values)              WRITE_SPI(_iface, value);      } @@ -749,7 +749,7 @@ private:          _ubx_tx_atten_val = ((attn_code & 0x3F) << 10);          set_gpio_field(TX_GAIN, attn_code);          write_gpio(); -        UHD_LOGV(rarely) << boost::format("UBX TX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_tx_atten_val << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX TX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_tx_atten_val ;          _tx_gain = gain;          return gain;      } @@ -762,7 +762,7 @@ private:          _ubx_rx_atten_val = ((attn_code & 0x3F) << 10);          set_gpio_field(RX_GAIN, attn_code);          write_gpio(); -        UHD_LOGV(rarely) << boost::format("UBX RX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_rx_atten_val << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX RX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_rx_atten_val ;          _rx_gain = gain;          return gain;      } @@ -786,18 +786,18 @@ private:          property_tree::sptr subtree = this->get_tx_subtree();          device_addr_t tune_args = subtree->access<device_addr_t>("tune_args").get();          is_int_n = boost::iequals(tune_args.get("mode_n",""), "integer"); -        UHD_LOGV(rarely) << boost::format("UBX TX: the requested frequency is %f MHz") % (freq/1e6) << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX TX: the requested frequency is %f MHz") % (freq/1e6) ;          double target_pfd_freq = _tx_target_pfd_freq;          if (is_int_n and tune_args.has_key("int_n_step"))          {              target_pfd_freq = tune_args.cast<double>("int_n_step", _tx_target_pfd_freq);              if (target_pfd_freq > _tx_target_pfd_freq)              { -                UHD_MSG(warning) +                UHD_LOGGER_WARNING("UBX")                      << boost::format("Requested int_n_step of %f MHz too large, clipping to %f MHz")                      % (target_pfd_freq/1e6)                      % (_tx_target_pfd_freq/1e6) -                    << std::endl; +                    ;                  target_pfd_freq = _tx_target_pfd_freq;              }          } @@ -925,7 +925,7 @@ private:          _txlo1_freq = freq_lo1;          _txlo2_freq = freq_lo2; -        UHD_LOGV(rarely) << boost::format("UBX TX: the actual frequency is %f MHz") % (_tx_freq/1e6) << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX TX: the actual frequency is %f MHz") % (_tx_freq/1e6) ;          return _tx_freq;      } @@ -938,7 +938,7 @@ private:          double ref_freq = _iface->get_clock_rate(dboard_iface::UNIT_RX);          bool is_int_n = false; -        UHD_LOGV(rarely) << boost::format("UBX RX: the requested frequency is %f MHz") % (freq/1e6) << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX RX: the requested frequency is %f MHz") % (freq/1e6) ;          property_tree::sptr subtree = this->get_rx_subtree();          device_addr_t tune_args = subtree->access<device_addr_t>("tune_args").get(); @@ -949,11 +949,11 @@ private:              target_pfd_freq = tune_args.cast<double>("int_n_step", _rx_target_pfd_freq);              if (target_pfd_freq > _rx_target_pfd_freq)              { -                UHD_MSG(warning) +                UHD_LOGGER_WARNING("UBX")                      << boost::format("Requested int_n_step of %f Mhz too large, clipping to %f MHz")                      % (target_pfd_freq/1e6)                      % (_rx_target_pfd_freq/1e6) -                    << std::endl; +                    ;                  target_pfd_freq = _rx_target_pfd_freq;              }          } @@ -1121,7 +1121,7 @@ private:          _rxlo1_freq = freq_lo1;          _rxlo2_freq = freq_lo2; -        UHD_LOGV(rarely) << boost::format("UBX RX: the actual frequency is %f MHz") % (_rx_freq/1e6) << std::endl; +        UHD_LOGGER_DEBUG("UBX") << boost::format("UBX RX: the actual frequency is %f MHz") % (_rx_freq/1e6) ;          return _rx_freq;      } diff --git a/host/lib/usrp/dboard/db_unknown.cpp b/host/lib/usrp/dboard/db_unknown.cpp index 2ed50cd91..1a63c9233 100644 --- a/host/lib/usrp/dboard/db_unknown.cpp +++ b/host/lib/usrp/dboard/db_unknown.cpp @@ -18,12 +18,11 @@  #include <uhd/types/ranges.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/static.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp>  #include <uhd/usrp/dboard_base.hpp>  #include <uhd/usrp/dboard_manager.hpp>  #include <boost/assign/list_of.hpp>  #include <boost/format.hpp> -#include <boost/foreach.hpp>  #include <boost/tuple/tuple.hpp>  #include <vector> @@ -43,13 +42,13 @@ static void warn_if_old_rfx(const dboard_id_t &dboard_id, const std::string &xx)          (old_ids_t("Flex 1800 Classic", 0x0030, 0x0031))          (old_ids_t("Flex 2400 Classic", 0x0007, 0x000b))      ; -    BOOST_FOREACH(const old_ids_t &old_id, old_rfx_ids){ +    for(const old_ids_t &old_id:  old_rfx_ids){          std::string name; dboard_id_t rx_id, tx_id;          boost::tie(name, rx_id, tx_id) = old_id;          if (              (xx == "RX" and rx_id == dboard_id) or              (xx == "TX" and tx_id == dboard_id) -        ) UHD_MSG(warning) << boost::format( +        ) UHD_LOGGER_WARNING("unknown_db") << boost::format(              "Detected %s daughterboard %s\n"              "This board requires modification to use.\n"              "See the daughterboard application notes.\n" diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp index 5afbb1f88..383daf15b 100644 --- a/host/lib/usrp/dboard/db_wbx_common.cpp +++ b/host/lib/usrp/dboard/db_wbx_common.cpp @@ -21,7 +21,7 @@  #include <uhd/types/sensors.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp>  using namespace uhd;  using namespace uhd::usrp; @@ -42,9 +42,9 @@ static int rx_pga0_gain_to_iobits(double &gain){      int attn_code = boost::math::iround(attn*2);      int iobits = ((~attn_code) << RX_ATTN_SHIFT) & RX_ATTN_MASK; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX RX Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x" -    ) % attn % attn_code % (iobits & RX_ATTN_MASK) % RX_ATTN_MASK << std::endl; +    ) % attn % attn_code % (iobits & RX_ATTN_MASK) % RX_ATTN_MASK ;      //the actual gain setting      gain = wbx_rx_gain_ranges["PGA0"].stop() - double(attn_code)/2; @@ -70,7 +70,7 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){      this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t());      this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_RX)); -    BOOST_FOREACH(const std::string &name, wbx_rx_gain_ranges.keys()){ +    for(const std::string &name:  wbx_rx_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&wbx_base::set_rx_gain, this, _1, name))              .set(wbx_rx_gain_ranges[name].start()); @@ -158,7 +158,7 @@ sensor_value_t wbx_base::get_locked(dboard_iface::unit_t unit){  }  void wbx_base::wbx_versionx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s) { -    BOOST_FOREACH(uint32_t reg, regs) { +    for(uint32_t reg:  regs) {          self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);      }  } diff --git a/host/lib/usrp/dboard/db_wbx_version2.cpp b/host/lib/usrp/dboard/db_wbx_version2.cpp index 489291881..134626928 100644 --- a/host/lib/usrp/dboard/db_wbx_version2.cpp +++ b/host/lib/usrp/dboard/db_wbx_version2.cpp @@ -23,7 +23,7 @@  #include <uhd/types/sensors.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/usrp/dboard_base.hpp>  #include <boost/assign/list_of.hpp>  #include <boost/format.hpp> @@ -58,9 +58,9 @@ static double tx_pga0_gain_to_dac_volts(double &gain){      //calculate the voltage for the aux dac      double dac_volts = gain*slope + min_volts; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX TX Gain: %f dB, dac_volts: %f V" -    ) % gain % dac_volts << std::endl; +    ) % gain % dac_volts ;      //the actual gain setting      gain = (dac_volts - min_volts)/slope; @@ -91,7 +91,7 @@ wbx_base::wbx_version2::wbx_version2(wbx_base *_self_wbx_base) {      // Register TX properties      ////////////////////////////////////////////////////////////////////      this->get_tx_subtree()->create<std::string>("name").set("WBXv2 TX"); -    BOOST_FOREACH(const std::string &name, wbx_v2_tx_gain_ranges.keys()){ +    for(const std::string &name:  wbx_v2_tx_gain_ranges.keys()){          self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&wbx_base::wbx_version2::set_tx_gain, this, _1, name))              .set(wbx_v2_tx_gain_ranges[name].start()); @@ -165,9 +165,9 @@ double wbx_base::wbx_version2::set_lo_freq(dboard_iface::unit_t unit, double tar      //clip to tuning range      target_freq = wbx_v2_freq_range.clip(target_freq); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      /*       * If the user sets 'mode_n=integer' in the tuning args, the user wishes to diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp index 1bd326e6f..5365a55e5 100644 --- a/host/lib/usrp/dboard/db_wbx_version3.cpp +++ b/host/lib/usrp/dboard/db_wbx_version3.cpp @@ -22,7 +22,7 @@  #include <uhd/types/sensors.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/usrp/dboard_base.hpp>  #include <boost/assign/list_of.hpp>  #include <boost/format.hpp> @@ -63,9 +63,9 @@ static int tx_pga0_gain_to_iobits(double &gain){              (attn_code &  1 ? 0 : TX_ATTN_1)          ) & TX_ATTN_MASK; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX TX Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x" -    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK << std::endl; +    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK ;      //the actual gain setting      gain = wbx_v3_tx_gain_ranges["PGA0"].stop() - double(attn_code); @@ -96,7 +96,7 @@ wbx_base::wbx_version3::wbx_version3(wbx_base *_self_wbx_base) {      // Register TX properties      ////////////////////////////////////////////////////////////////////      this->get_tx_subtree()->create<std::string>("name").set("WBXv3 TX"); -    BOOST_FOREACH(const std::string &name, wbx_v3_tx_gain_ranges.keys()){ +    for(const std::string &name:  wbx_v3_tx_gain_ranges.keys()){          self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&wbx_base::wbx_version3::set_tx_gain, this, _1, name))              .set(wbx_v3_tx_gain_ranges[name].start()); @@ -196,9 +196,9 @@ double wbx_base::wbx_version3::set_lo_freq(dboard_iface::unit_t unit, double tar      //clip to tuning range      target_freq = wbx_v3_freq_range.clip(target_freq); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      /*       * If the user sets 'mode_n=integer' in the tuning args, the user wishes to diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp index 3cc0f1887..f08504f09 100644 --- a/host/lib/usrp/dboard/db_wbx_version4.cpp +++ b/host/lib/usrp/dboard/db_wbx_version4.cpp @@ -22,7 +22,7 @@  #include <uhd/types/sensors.hpp>  #include <uhd/utils/assert_has.hpp>  #include <uhd/utils/algorithm.hpp> -#include <uhd/utils/msg.hpp> +  #include <uhd/usrp/dboard_base.hpp>  #include <boost/assign/list_of.hpp>  #include <boost/format.hpp> @@ -64,9 +64,9 @@ static int tx_pga0_gain_to_iobits(double &gain){              (attn_code &  1 ? 0 : TX_ATTN_1)          ) & TX_ATTN_MASK; -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX TX Attenuation: %f dB, Code: %d, IO Bits %x, Mask: %x" -    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK << std::endl; +    ) % attn % attn_code % (iobits & TX_ATTN_MASK) % TX_ATTN_MASK ;      //the actual gain setting      gain = wbx_v4_tx_gain_ranges["PGA0"].stop() - double(attn_code); @@ -103,7 +103,7 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) {      //get_tx_id() will always return GDB ID, so use RX ID to determine WBXv4 vs. WBX-120      if(rx_id == 0x0063) this->get_tx_subtree()->create<std::string>("name").set("WBXv4 TX");      else if(rx_id == 0x0081) this->get_tx_subtree()->create<std::string>("name").set("WBX-120 TX"); -    BOOST_FOREACH(const std::string &name, wbx_v4_tx_gain_ranges.keys()){ +    for(const std::string &name:  wbx_v4_tx_gain_ranges.keys()){          self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&wbx_base::wbx_version4::set_tx_gain, this, _1, name))              .set(wbx_v4_tx_gain_ranges[name].start()); @@ -204,9 +204,9 @@ double wbx_base::wbx_version4::set_lo_freq(dboard_iface::unit_t unit, double tar      //clip to tuning range      target_freq = wbx_v4_freq_range.clip(target_freq); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("WBX") << boost::format(          "WBX tune: target frequency %f MHz" -    ) % (target_freq/1e6) << std::endl; +    ) % (target_freq/1e6) ;      /*       * If the user sets 'mode_n=integer' in the tuning args, the user wishes to diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 6876ee4be..9d8ef63f2 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -135,9 +135,9 @@ private:      void spi_reset(void);      void send_reg(uint8_t addr){          uint32_t value = _max2829_regs.get_reg(addr); -        UHD_LOGV(often) << boost::format( +        UHD_LOGGER_DEBUG("XCVR2450") << boost::format(              "XCVR2450: send reg 0x%02x, value 0x%05x" -        ) % int(addr) % value << std::endl; +        ) % int(addr) % value ;          this->get_iface()->write_spi(              dboard_iface::UNIT_RX,              spi_config_t::EDGE_RISE, @@ -234,7 +234,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){          .set_publisher(boost::bind(&xcvr2450::get_locked, this));      this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi")          .set_publisher(boost::bind(&xcvr2450::get_rssi, this)); -    BOOST_FOREACH(const std::string &name, xcvr_rx_gain_ranges.keys()){ +    for(const std::string &name:  xcvr_rx_gain_ranges.keys()){          this->get_rx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&xcvr2450::set_rx_gain, this, _1, name))              .set(xcvr_rx_gain_ranges[name].start()); @@ -270,7 +270,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){          .set("XCVR2450 TX");      this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")          .set_publisher(boost::bind(&xcvr2450::get_locked, this)); -    BOOST_FOREACH(const std::string &name, xcvr_tx_gain_ranges.keys()){ +    for(const std::string &name:  xcvr_tx_gain_ranges.keys()){          this->get_tx_subtree()->create<double>("gains/"+name+"/value")              .set_coercer(boost::bind(&xcvr2450::set_tx_gain, this, _1, name))              .set(xcvr_tx_gain_ranges[name].start()); @@ -391,20 +391,20 @@ double xcvr2450::set_lo_freq_core(double target_freq){      double N = double(intdiv) + double(fracdiv)/double(1 << 16);      _lo_freq = (N*ref_freq)/(scaler*R*_ad9515div); -    UHD_LOGV(often) +    UHD_LOGGER_DEBUG("XCVR2450")          << boost::format("XCVR2450 tune:\n")          << boost::format("    R=%d, N=%f, ad9515=%d, scaler=%f\n") % R % N % _ad9515div % scaler          << 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; +        ;      //high-high band or low-high band?      if(_lo_freq > (5.35e9 + 5.47e9)/2.0){ -        UHD_LOGV(often) << "XCVR2450 tune: Using  high-high band" << std::endl; +        UHD_LOGGER_DEBUG("XCVR2450") << "XCVR2450 tune: Using  high-high band" ;          _max2829_regs.band_select_802_11a = max2829_regs_t::BAND_SELECT_802_11A_5_47GHZ_TO_5_875GHZ;      }else{ -        UHD_LOGV(often) << "XCVR2450 tune: Using  low-high band" << std::endl; +        UHD_LOGGER_DEBUG("XCVR2450") << "XCVR2450 tune: Using  low-high band" ;          _max2829_regs.band_select_802_11a = max2829_regs_t::BAND_SELECT_802_11A_4_9GHZ_TO_5_35GHZ;      } @@ -655,9 +655,9 @@ double xcvr2450::set_rx_bandwidth(double bandwidth){      //update register      send_reg(0x7); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("XCVR2450") << boost::format(          "XCVR2450 RX Bandwidth (lp_fc): %f Hz, coarse reg: %d, fine reg: %d" -    ) % _rx_bandwidth % (int(_max2829_regs.rx_lpf_coarse_adj)) % (int(_max2829_regs.rx_lpf_fine_adj)) << std::endl; +    ) % _rx_bandwidth % (int(_max2829_regs.rx_lpf_coarse_adj)) % (int(_max2829_regs.rx_lpf_fine_adj)) ;      return 2.0*_rx_bandwidth;  } @@ -675,9 +675,9 @@ double xcvr2450::set_tx_bandwidth(double bandwidth){      //update register      send_reg(0x7); -    UHD_LOGV(often) << boost::format( +    UHD_LOGGER_DEBUG("XCVR2450") << boost::format(          "XCVR2450 TX Bandwidth (lp_fc): %f Hz, coarse reg: %d" -    ) % _tx_bandwidth % (int(_max2829_regs.tx_lpf_coarse_adj)) << std::endl; +    ) % _tx_bandwidth % (int(_max2829_regs.tx_lpf_coarse_adj)) ;      //convert lowpass back to complex bandpass bandwidth      return 2.0*_tx_bandwidth; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp index 346f39589..ddbbfaefb 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp @@ -87,10 +87,10 @@ public:          //Initialize clocks and LO          bool found_rate = false; -        BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) { +        for(double rate:  _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) {              found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ);          } -        BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) { +        for(double rate:  _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) {              found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ);          }          if (not found_rate) { @@ -506,7 +506,7 @@ private:    //Functions      void _write_lo_spi(dboard_iface::unit_t unit, const std::vector<uint32_t> ®s)      { -        BOOST_FOREACH(uint32_t reg, regs) { +        for(uint32_t reg:  regs) {               spi_config_t spi_config = spi_config_t(spi_config_t::EDGE_RISE);               spi_config.use_custom_divider = true;               spi_config.divider = 67; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp index 3b41972da..1a66e8fe7 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_experts.cpp @@ -18,6 +18,7 @@  #include "twinrx_experts.hpp"  #include "twinrx_gain_tables.hpp"  #include <uhd/utils/math.hpp> +#include <uhd/utils/log.hpp>  #include <uhd/exception.hpp>  #include <uhd/types/dict.hpp>  #include <uhd/types/ranges.hpp> @@ -481,7 +482,7 @@ void twinrx_ant_gain_expert::resolve()              (_ch0_preamp2 != _ch1_preamp2) or              (_ch0_lb_preamp_presel != _ch1_lb_preamp_presel))          { -            UHD_MSG(warning) << "incompatible gain settings for antenna sharing. temporarily using Ch0 settings for Ch1."; +            UHD_LOGGER_WARNING("TWINRX") << "incompatible gain settings for antenna sharing. temporarily using Ch0 settings for Ch1.";          }          _ant0_input_atten       = _ch0_input_atten;          _ant0_preamp1           = _ch0_preamp1; @@ -499,7 +500,7 @@ void twinrx_ant_gain_expert::resolve()              (_ch0_preamp2 != _ch1_preamp2) or              (_ch0_lb_preamp_presel != _ch1_lb_preamp_presel))          { -            UHD_MSG(warning) << "incompatible gain settings for antenna sharing. temporarily using Ch0 settings for Ch1."; +            UHD_LOGGER_WARNING("TWINRX") << "incompatible gain settings for antenna sharing. temporarily using Ch0 settings for Ch1.";          }          _ant1_input_atten       = _ch0_input_atten;          _ant1_preamp1           = _ch0_preamp1; | 
