From df91040196c536c1cf0a57379b946c89ea73ae6b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 4 Jul 2011 08:33:47 -0700 Subject: usrp: added clipping to link max rate when setting sample rate --- host/lib/usrp/usrp2/usrp2_impl.cpp | 2 ++ host/lib/usrp/usrp2/usrp2_impl.hpp | 1 + 2 files changed, 3 insertions(+) (limited to 'host/lib/usrp/usrp2') diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 9741bec44..390d1813b 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -445,6 +445,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ _mbc[mb].iface, U2_REG_SR_ADDR(SR_RX_DSP1), U2_REG_SR_ADDR(SR_RX_CTRL1), USRP2_RX_SID_BASE + 1, true )); for (size_t dspno = 0; dspno < _mbc[mb].rx_dsps.size(); dspno++){ + _mbc[mb].rx_dsps[dspno]->set_link_rate(USRP2_LINK_RATE_BPS); _tree->access(mb_path / "tick_rate") .subscribe(boost::bind(&rx_dsp_core_200::set_tick_rate, _mbc[mb].rx_dsps[dspno], _1)); //This is a hack/fix for the lingering packet problem. @@ -469,6 +470,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ _mbc[mb].tx_dsp = tx_dsp_core_200::make( _mbc[mb].iface, U2_REG_SR_ADDR(SR_TX_DSP), U2_REG_SR_ADDR(SR_TX_CTRL), USRP2_TX_ASYNC_SID ); + _mbc[mb].tx_dsp->set_link_rate(USRP2_LINK_RATE_BPS); _tree->access(mb_path / "tick_rate") .subscribe(boost::bind(&tx_dsp_core_200::set_tick_rate, _mbc[mb].tx_dsp, _1)); _tree->create(mb_path / "tx_dsps/0/rate/value") diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index eae7b7dcb..f2125e094 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -43,6 +43,7 @@ #include #include +static const double USRP2_LINK_RATE_BPS = 1000e6/8; static const double mimo_clock_delay_usrp2_rev4 = 4.18e-9; static const double mimo_clock_delay_usrp_n2xx = 3.55e-9; static const size_t mimo_clock_sync_delay_cycles = 137; -- cgit v1.2.3