diff options
| author | Balint Seeber <balint@ettus.com> | 2014-03-19 14:33:12 -0700 | 
|---|---|---|
| committer | Balint Seeber <balint@ettus.com> | 2014-03-19 14:33:12 -0700 | 
| commit | e898450a2e9bff57ebc25b48ed10508ac6383b30 (patch) | |
| tree | 5af4fee21865c3a5667ecfcffe709661cfa90e80 /host/lib/usrp/b200 | |
| parent | 35a25fb3792ba4e30c5ae1052441ba3f44d9b65e (diff) | |
| download | uhd-e898450a2e9bff57ebc25b48ed10508ac6383b30.tar.gz uhd-e898450a2e9bff57ebc25b48ed10508ac6383b30.tar.bz2 uhd-e898450a2e9bff57ebc25b48ed10508ac6383b30.zip | |
b200: addressed review comments (boost::uint16_t & source code long line breaking)
Diffstat (limited to 'host/lib/usrp/b200')
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 25 | 
1 files changed, 19 insertions, 6 deletions
| diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index a80e96ba2..a02ef2e03 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -156,12 +156,12 @@ b200_impl::b200_impl(const device_addr_t &device_addr)      const fs_path mb_path = "/mboards/0";      //try to match the given device address with something on the USB bus -    unsigned int vid = B200_VENDOR_ID; -    unsigned int pid = B200_PRODUCT_ID; +    boost::uint16_t vid = B200_VENDOR_ID; +    boost::uint16_t pid = B200_PRODUCT_ID;      if (device_addr.has_key("vid")) -            sscanf(device_addr.get("vid").c_str(), "%x", &vid); +            sscanf(device_addr.get("vid").c_str(), "%hx", &vid);      if (device_addr.has_key("pid")) -            sscanf(device_addr.get("pid").c_str(), "%x", &pid); +            sscanf(device_addr.get("pid").c_str(), "%hx", &pid);      std::vector<usb_device_handle::sptr> device_list =          usb_device_handle::get_device_list(vid, pid); @@ -664,13 +664,26 @@ void b200_impl::enforce_tick_rate_limits(size_t chan_count, double tick_rate, co      const size_t max_chans = 2;      if (chan_count > max_chans)      { -        throw uhd::value_error(boost::str(boost::format("cannot not setup %d %s channels (maximum is %d)") % chan_count % (direction ? direction : "data") % max_chans)); +        throw uhd::value_error(boost::str( +            boost::format("cannot not setup %d %s channels (maximum is %d)") +                % chan_count +                % (direction ? direction : "data") +                % max_chans +        ));      }      else      {          const double max_tick_rate = ((chan_count <= 1) ? AD9361_1_CHAN_CLOCK_RATE_MAX : AD9361_2_CHAN_CLOCK_RATE_MAX);          if (tick_rate > max_tick_rate) -            throw uhd::value_error(boost::str(boost::format("current master clock rate (%.2f MHz) exceeds maximum possible master clock rate (%.2f MHz) when using %d %s channels") % (tick_rate/1e6) % (max_tick_rate/1e6) % chan_count % (direction ? direction : "data"))); +        { +            throw uhd::value_error(boost::str( +                boost::format("current master clock rate (%.2f MHz) exceeds maximum possible master clock rate (%.2f MHz) when using %d %s channels") +                    % (tick_rate/1e6) +                    % (max_tick_rate/1e6) +                    % chan_count +                    % (direction ? direction : "data") +            )); +        }      }  } | 
