aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
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/usrp/cores
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/usrp/cores')
-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
4 files changed, 13 insertions, 0 deletions
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;