diff options
author | Josh Blum <josh@joshknows.com> | 2011-07-04 07:21:53 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-07-04 07:21:53 -0700 |
commit | 729b284f628f3326d774262570b68540d7de9baa (patch) | |
tree | 85bd79634c50fd32423fd4c29f15e18744aff97f /host/lib/usrp/usrp1 | |
parent | 34265334d18589a377ab42df211eb33054340ae6 (diff) | |
download | uhd-729b284f628f3326d774262570b68540d7de9baa.tar.gz uhd-729b284f628f3326d774262570b68540d7de9baa.tar.bz2 uhd-729b284f628f3326d774262570b68540d7de9baa.zip |
usrp: handle frontend swapping if the first subdev is QI or Q
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r-- | host/lib/usrp/usrp1/io_impl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/soft_time_ctrl.cpp | 10 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/soft_time_ctrl.hpp | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 461529ae2..bf34fde4f 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -511,7 +511,5 @@ size_t usrp1_impl::recv( recv_mode, timeout ); - _soft_time_ctrl->recv_post(metadata, num_samps_recvd); - - return num_samps_recvd; + return _soft_time_ctrl->recv_post(metadata, num_samps_recvd); } diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp index 2728ff755..ac0899e28 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp @@ -90,13 +90,13 @@ public: /******************************************************************* * Receive control ******************************************************************/ - void recv_post(rx_metadata_t &md, size_t &nsamps){ + size_t recv_post(rx_metadata_t &md, const size_t nsamps){ boost::mutex::scoped_lock lock(_update_mutex); //Since it timed out on the receive, check for inline messages... //Must do a post check because recv() will not wake up for a message. if (md.error_code == rx_metadata_t::ERROR_CODE_TIMEOUT){ - if (_inline_msg_queue.pop_with_haste(md)) return; + if (_inline_msg_queue.pop_with_haste(md)) return 0; } //load the metadata with the expected time @@ -104,7 +104,7 @@ public: md.time_spec = time_now(); //none of the stuff below matters in continuous streaming mode - if (_stream_mode == stream_cmd_t::STREAM_MODE_START_CONTINUOUS) return; + if (_stream_mode == stream_cmd_t::STREAM_MODE_START_CONTINUOUS) return nsamps; //When to stop streaming: //The samples have been received and the stream mode is non-continuous. @@ -118,15 +118,15 @@ public: _inline_msg_queue.push_with_pop_on_full(metadata); } //continue to next case... case stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE: - nsamps = _nsamps_remaining; //set nsamps, then stop md.end_of_burst = true; this->issue_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); - return; + return _nsamps_remaining; default: break; } //update the consumed samples _nsamps_remaining -= nsamps; + return nsamps; } void issue_stream_cmd(const stream_cmd_t &cmd){ diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.hpp b/host/lib/usrp/usrp1/soft_time_ctrl.hpp index b2bf6c6f9..e91aaf6a2 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.hpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.hpp @@ -54,7 +54,7 @@ public: virtual time_spec_t get_time(void) = 0; //! Call after the internal recv function - virtual void recv_post(rx_metadata_t &md, size_t &nsamps) = 0; + virtual size_t recv_post(rx_metadata_t &md, const size_t nsamps) = 0; //! Call before the internal send function virtual bool send_pre(const tx_metadata_t &md, double &timeout) = 0; |