summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-21 09:55:55 -0800
committerJosh Blum <josh@joshknows.com>2011-11-21 09:55:55 -0800
commitdac9a5001a0cdb2f03241025fc61cca7baeb3787 (patch)
tree7d9ce02e1971183b0b19ac7e4f0243c2fb2327ad /host/lib
parent1a25e4867b395a35b718effe9d89dd217ff71941 (diff)
downloaduhd-dac9a5001a0cdb2f03241025fc61cca7baeb3787.tar.gz
uhd-dac9a5001a0cdb2f03241025fc61cca7baeb3787.tar.bz2
uhd-dac9a5001a0cdb2f03241025fc61cca7baeb3787.zip
usrp: clear dsp when making new streamer
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/b100/io_impl.cpp1
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp5
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.hpp2
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp4
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.hpp2
-rw-r--r--host/lib/usrp/e100/io_impl.cpp1
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp1
7 files changed, 16 insertions, 0 deletions
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index abbd9864f..ccd00a91f 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -286,6 +286,7 @@ tx_streamer::sptr b100_impl::get_tx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
+ _tx_dsp->clear();
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
));
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index b97f9c58e..7c9fe0695 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -79,7 +79,12 @@ public:
_iface->poke32(REG_RX_CTRL_VRT_TLR, 0);
}
+ void clear(void){
+ _iface->poke32(REG_RX_CTRL_CLEAR, 1); //reset
+ }
+
void set_nsamps_per_packet(const size_t nsamps){
+ this->clear(); // a good place to clear as well!
_iface->poke32(REG_RX_CTRL_NSAMPS_PP, nsamps);
}
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.hpp b/host/lib/usrp/cores/rx_dsp_core_200.hpp
index 89b8c1f51..58be51eee 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.hpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.hpp
@@ -36,6 +36,8 @@ public:
const boost::uint32_t sid, const bool lingering_packet = false
);
+ virtual void clear(void) = 0;
+
virtual void set_nsamps_per_packet(const size_t nsamps) = 0;
virtual void issue_stream_command(const uhd::stream_cmd_t &stream_cmd) = 0;
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index 9d90d30cc..38d04a7de 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -65,6 +65,10 @@ public:
_iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_PACKET);
}
+ void clear(void){
+ _iface->poke32(REG_TX_CTRL_CLEAR_STATE, 1); //reset
+ }
+
void set_tick_rate(const double rate){
_tick_rate = rate;
}
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.hpp b/host/lib/usrp/cores/tx_dsp_core_200.hpp
index e6be63557..50d128df4 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.hpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.hpp
@@ -34,6 +34,8 @@ public:
const boost::uint32_t sid
);
+ virtual void clear(void) = 0;
+
virtual void set_tick_rate(const double rate) = 0;
virtual void set_link_rate(const double rate) = 0;
diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp
index 3b0828b45..855fda0d7 100644
--- a/host/lib/usrp/e100/io_impl.cpp
+++ b/host/lib/usrp/e100/io_impl.cpp
@@ -362,6 +362,7 @@ tx_streamer::sptr e100_impl::get_tx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];
UHD_ASSERT_THROW(dsp == 0); //always 0
+ _tx_dsp->clear();
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&zero_copy_if::get_send_buff, _data_transport, _1
));
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 8018875ec..742fe3e94 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -474,6 +474,7 @@ tx_streamer::sptr usrp2_impl::get_tx_stream(const uhd::stream_args_t &args_){
num_chan_so_far += _mbc[mb].tx_chan_occ;
if (chan < num_chan_so_far){
const size_t dsp = chan + _mbc[mb].tx_chan_occ - num_chan_so_far;
+ _mbc[mb].tx_dsp->clear();
my_streamer->set_xport_chan_get_buff(chan_i, boost::bind(
&usrp2_impl::io_impl::get_send_buff, _io_impl.get(), abs, _1
));