diff options
-rw-r--r-- | host/lib/thread_priority.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/clock_ctrl.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_iface.cpp | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/host/lib/thread_priority.cpp b/host/lib/thread_priority.cpp index 30b184123..c35e5fcb1 100644 --- a/host/lib/thread_priority.cpp +++ b/host/lib/thread_priority.cpp @@ -58,7 +58,7 @@ static void check_priority_range(float priority){ sched_param sp; sp.sched_priority = int(priority*(max_pri - min_pri)) + min_pri; int ret = pthread_setschedparam(pthread_self(), policy, &sp); - if (ret == -1) throw std::runtime_error("error in pthread_setschedparam"); + if (ret != 0) throw std::runtime_error("error in pthread_setschedparam"); } /*********************************************************************** diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp index 59fac6fcf..b9be037c0 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.cpp +++ b/host/lib/usrp/usrp2/clock_ctrl.cpp @@ -61,9 +61,7 @@ public: this->enable_external_ref(false); this->enable_rx_dboard_clock(false); - this->set_rate_rx_dboard_clock(get_rates_rx_dboard_clock().at(0)); this->enable_tx_dboard_clock(false); - this->set_rate_tx_dboard_clock(get_rates_tx_dboard_clock().at(0)); /* private clock enables, must be set here */ this->enable_dac_clock(true); diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index ec6c98186..6f2fb9396 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -21,6 +21,7 @@ #include <uhd/usrp/dboard_iface.hpp> #include <uhd/types/dict.hpp> #include <uhd/utils/assert.hpp> +#include <uhd/utils/algorithm.hpp> #include <boost/assign/list_of.hpp> #include <boost/asio.hpp> //htonl and ntohl #include <boost/math/special_functions/round.hpp> @@ -109,6 +110,10 @@ usrp2_dboard_iface::usrp2_dboard_iface( _dac_regs[unit].cmd = ad5623_regs_t::CMD_RESET; this->_write_aux_dac(unit); } + + //init the clock rate shadows with max rate clock + this->set_clock_rate(UNIT_RX, sorted(this->get_clock_rates(UNIT_RX)).back()); + this->set_clock_rate(UNIT_TX, sorted(this->get_clock_rates(UNIT_TX)).back()); } usrp2_dboard_iface::~usrp2_dboard_iface(void){ |