diff options
author | Josh Blum <josh@joshknows.com> | 2010-09-30 15:03:04 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-09-30 15:03:04 -0700 |
commit | ccb7adcb150ae481ce08d4e0fa32641b5aec4e6e (patch) | |
tree | 111e27a507d711f890f99ea47c57f25757482e03 /host/lib/usrp/usrp2 | |
parent | 507283b3d43d653bf7ff1b2aa04f3d642297c9b1 (diff) | |
parent | 790a5ac665144180cde712d46b799a115bb74e46 (diff) | |
download | uhd-ccb7adcb150ae481ce08d4e0fa32641b5aec4e6e.tar.gz uhd-ccb7adcb150ae481ce08d4e0fa32641b5aec4e6e.tar.bz2 uhd-ccb7adcb150ae481ce08d4e0fa32641b5aec4e6e.zip |
Merge branch 'master' into usrp_e_next
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r-- | host/lib/usrp/usrp2/dboard_iface.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index f6d2b718a..fdfbf0d17 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -61,6 +61,7 @@ public: double get_clock_rate(unit_t); std::vector<double> get_clock_rates(unit_t); void set_clock_enabled(unit_t, bool); + double get_codec_rate(unit_t); void write_spi( unit_t unit, @@ -158,6 +159,9 @@ void usrp2_dboard_iface::set_clock_enabled(unit_t unit, bool enb){ } } +double usrp2_dboard_iface::get_codec_rate(unit_t){ + return _clock_ctrl->get_master_clock_rate(); +} /*********************************************************************** * GPIO **********************************************************************/ diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 91a1b2344..3395f94e2 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -33,6 +33,7 @@ using namespace uhd::transport; namespace asio = boost::asio; static const int underflow_flags = async_metadata_t::EVENT_CODE_UNDERFLOW | async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET; +static const double RECV_TIMEOUT_MS = 100; /*********************************************************************** * io impl details (internal to this file) @@ -90,7 +91,7 @@ void usrp2_impl::io_impl::recv_pirate_loop( size_t next_packet_seq = 0; while(recv_pirate_crew_raiding){ - managed_recv_buffer::sptr buff = zc_if->get_recv_buff(); + managed_recv_buffer::sptr buff = zc_if->get_recv_buff(RECV_TIMEOUT_MS); if (not buff.get()) continue; //ignore timeout/error buffers try{ @@ -150,7 +151,7 @@ void usrp2_impl::io_init(void){ std::memcpy(send_buff->cast<void*>(), &data, sizeof(data)); send_buff->commit(sizeof(data)); //drain the recv buffers (may have junk) - while (data_transport->get_recv_buff().get()); + while (data_transport->get_recv_buff(RECV_TIMEOUT_MS).get()){}; } //the number of recv frames is the number for the first transport |