diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-07-26 11:48:23 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-07-26 11:48:23 -0700 |
commit | 8d18814cc33cc9a703da5e7eeee00a0d2499074b (patch) | |
tree | baa9d51e6fe867de91662ed9542cfe0bd881b9b8 /host/lib | |
parent | 5ba60fa140d2f6e96aea1394554232809b3eeae9 (diff) | |
parent | f86c25317b457b280c697fc47905c79bdbbc0c93 (diff) | |
download | uhd-8d18814cc33cc9a703da5e7eeee00a0d2499074b.tar.gz uhd-8d18814cc33cc9a703da5e7eeee00a0d2499074b.tar.bz2 uhd-8d18814cc33cc9a703da5e7eeee00a0d2499074b.zip |
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into codec_gains
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/transport/vrt_packet_handler.hpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/dsp_utils.hpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/tune_helper.cpp | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp index 07ad9115c..cf9d649dd 100644 --- a/host/lib/transport/vrt_packet_handler.hpp +++ b/host/lib/transport/vrt_packet_handler.hpp @@ -286,7 +286,6 @@ namespace vrt_packet_handler{ * Pack a vrt header, copy-convert the data, and send it. * - helper function for vrt_packet_handler::send ******************************************************************/ - template<typename vrt_packer_type> static UHD_INLINE void _send1( send_state &state, const std::vector<const void *> &buffs, @@ -295,7 +294,7 @@ namespace vrt_packet_handler{ uhd::transport::vrt::if_packet_info_t &if_packet_info, const uhd::io_type_t &io_type, const uhd::otw_type_t &otw_type, - vrt_packer_type vrt_packer, + const vrt_packer_t &vrt_packer, const get_send_buffs_t &get_send_buffs, size_t vrt_header_offset_words32 ){ diff --git a/host/lib/usrp/dsp_utils.hpp b/host/lib/usrp/dsp_utils.hpp index 2f246c788..ebed12c41 100644 --- a/host/lib/usrp/dsp_utils.hpp +++ b/host/lib/usrp/dsp_utils.hpp @@ -82,11 +82,11 @@ namespace dsp_type1{ double &freq, double codec_rate ){ - UHD_ASSERT_THROW(freq >= -codec_rate/2.0 and freq < codec_rate/2.0); + UHD_ASSERT_THROW(std::abs(freq) <= codec_rate/2.0); static const double scale_factor = std::pow(2.0, 32); //calculate the freq register word (signed) - boost::int32_t freq_word = boost::math::iround((freq / codec_rate) * scale_factor); + boost::int32_t freq_word = boost::int32_t(boost::math::round((freq / codec_rate) * scale_factor)); //update the actual frequency freq = (double(freq_word) / scale_factor) * codec_rate; diff --git a/host/lib/usrp/tune_helper.cpp b/host/lib/usrp/tune_helper.cpp index c5cce3ecf..e516477d3 100644 --- a/host/lib/usrp/tune_helper.cpp +++ b/host/lib/usrp/tune_helper.cpp @@ -16,10 +16,10 @@ // #include <uhd/usrp/tune_helper.hpp> -#include <uhd/utils/algorithm.hpp> #include <uhd/usrp/subdev_props.hpp> #include <uhd/usrp/dsp_props.hpp> #include <uhd/usrp/dboard_iface.hpp> //unit_t +#include <boost/math/special_functions/sign.hpp> #include <cmath> using namespace uhd; @@ -46,7 +46,7 @@ static tune_result_t tune_xx_subdev_and_dxc( double delta_freq = std::fmod(target_freq - actual_inter_freq, dxc_sample_rate); bool outside_of_nyquist = std::abs(delta_freq) > dxc_sample_rate/2.0; double target_dxc_freq = (outside_of_nyquist)? - std::signum(delta_freq)*dxc_sample_rate - delta_freq : -delta_freq; + boost::math::sign(delta_freq)*dxc_sample_rate - delta_freq : -delta_freq; //invert the sign on the dxc freq given the following conditions if (unit == dboard_iface::UNIT_TX) target_dxc_freq *= -1.0; |