aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-12-20 17:38:00 -0800
committerJosh Blum <josh@joshknows.com>2011-12-20 17:38:00 -0800
commit81289ab0510c847daacf75e261cad2de5cd7d508 (patch)
treeaa8a92f1dab55b9183f1bf14d78c25a3cde255f4 /host/lib/usrp/cores
parentcdf8de0ca34d787ee9b3fed543f5e45bc2df00fa (diff)
downloaduhd-81289ab0510c847daacf75e261cad2de5cd7d508.tar.gz
uhd-81289ab0510c847daacf75e261cad2de5cd7d508.tar.bz2
uhd-81289ab0510c847daacf75e261cad2de5cd7d508.zip
usrp: added underflow_policy to tx streamer args
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp12
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.hpp2
2 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index 4e1a3e44d..c5de4e361 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -60,13 +60,23 @@ public:
{
//init the tx control registers
this->clear();
+ this->set_underflow_policy("next_packet");
}
void clear(void){
_iface->poke32(REG_TX_CTRL_CLEAR_STATE, 1); //reset
_iface->poke32(REG_TX_CTRL_NUM_CHAN, 0); //1 channel
_iface->poke32(REG_TX_CTRL_REPORT_SID, _sid);
- _iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_PACKET);
+ }
+
+ void set_underflow_policy(const std::string &policy){
+ if (policy == "next_packet"){
+ _iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_PACKET);
+ }
+ else if (policy == "next_burst"){
+ _iface->poke32(REG_TX_CTRL_POLICY, FLAG_TX_CTRL_POLICY_NEXT_BURST);
+ }
+ else throw uhd::value_error("USRP TX cannot handle requested underflow policy: " + policy);
}
void set_tick_rate(const double rate){
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.hpp b/host/lib/usrp/cores/tx_dsp_core_200.hpp
index 50d128df4..4b39a5b07 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.hpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.hpp
@@ -50,6 +50,8 @@ public:
virtual void set_updates(const size_t cycles_per_up, const size_t packets_per_up) = 0;
+ virtual void set_underflow_policy(const std::string &policy) = 0;
+
};
#endif /* INCLUDED_LIBUHD_USRP_TX_DSP_CORE_200_HPP */