summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-11 18:41:58 -0800
committerJosh Blum <josh@joshknows.com>2010-12-11 18:42:41 -0800
commite436016638b4d2b81d50ee2de98c271615eee806 (patch)
tree35aa87e90d62cc098f1953e47dfae8c33f8f7906 /host/lib/usrp/usrp2
parentcedb517a70a81fb9604e8f08c8aed681ce70dbbb (diff)
downloaduhd-e436016638b4d2b81d50ee2de98c271615eee806.tar.gz
uhd-e436016638b4d2b81d50ee2de98c271615eee806.tar.bz2
uhd-e436016638b4d2b81d50ee2de98c271615eee806.zip
usrp2: provided way to disable flow control updates by setting to zero
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 6f1184ad7..766ea993c 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -97,16 +97,19 @@ usrp2_mboard_impl::usrp2_mboard_impl(
_iface->poke32(_iface->regs.tx_ctrl_report_sid, usrp2_impl::ASYNC_SID);
_iface->poke32(_iface->regs.tx_ctrl_policy, U2_FLAG_TX_CTRL_POLICY_NEXT_PACKET);
- //setting the cycles per update
- const double ups_per_sec = flow_control_hints.cast<double>("ups_per_sec", 100);
- const size_t cycles_per_up = size_t(_clock_ctrl->get_master_clock_rate()/ups_per_sec);
- _iface->poke32(_iface->regs.tx_ctrl_cycles_per_up, U2_FLAG_TX_CTRL_UP_ENB | cycles_per_up);
- _iface->poke32(_iface->regs.tx_ctrl_cycles_per_up, 0); //cycles per update is disabled
-
- //setting the packets per update
- const double ups_per_fifo = flow_control_hints.cast<double>("ups_per_fifo", 8);
- const size_t packets_per_up = size_t(usrp2_impl::sram_bytes/ups_per_fifo/data_transport->get_send_frame_size());
- _iface->poke32(_iface->regs.tx_ctrl_packets_per_up, U2_FLAG_TX_CTRL_UP_ENB | packets_per_up);
+ //setting the cycles per update (disabled by default)
+ const double ups_per_sec = flow_control_hints.cast<double>("ups_per_sec", 0.0);
+ if (ups_per_sec > 0.0){
+ const size_t cycles_per_up = size_t(_clock_ctrl->get_master_clock_rate()/ups_per_sec);
+ _iface->poke32(_iface->regs.tx_ctrl_cycles_per_up, U2_FLAG_TX_CTRL_UP_ENB | cycles_per_up);
+ }
+
+ //setting the packets per update (enabled by default)
+ const double ups_per_fifo = flow_control_hints.cast<double>("ups_per_fifo", 8.0);
+ if (ups_per_fifo > 0.0){
+ const size_t packets_per_up = size_t(usrp2_impl::sram_bytes/ups_per_fifo/data_transport->get_send_frame_size());
+ _iface->poke32(_iface->regs.tx_ctrl_packets_per_up, U2_FLAG_TX_CTRL_UP_ENB | packets_per_up);
+ }
//init the ddc
init_ddc_config();