From 7dc76db5737943fa24a0321dd7a4ace36db6c2c6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 5 Dec 2011 13:32:02 -0800 Subject: usrp: rx dsp move init code into clear (like tx) --- host/lib/usrp/cores/rx_dsp_core_200.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/cores') diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp index 481260e32..f184a8346 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -57,7 +57,7 @@ public: const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid, const bool lingering_packet ): - _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base) + _iface(iface), _dsp_base(dsp_base), _ctrl_base(ctrl_base), _sid(sid) { //This is a hack/fix for the lingering packet problem. //The caller should also flush the recv transports @@ -67,6 +67,10 @@ public: issue_stream_command(stream_cmd); } + this->clear(); + } + + void clear(void){ _iface->poke32(REG_RX_CTRL_CLEAR, 1); //reset _iface->poke32(REG_RX_CTRL_NCHANNELS, 1); _iface->poke32(REG_RX_CTRL_VRT_HDR, 0 @@ -75,14 +79,10 @@ public: | (0x3 << 22) //integer time other | (0x1 << 20) //fractional time sample count ); - _iface->poke32(REG_RX_CTRL_VRT_SID, sid); + _iface->poke32(REG_RX_CTRL_VRT_SID, _sid); _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){ _iface->poke32(REG_RX_CTRL_NSAMPS_PP, nsamps); } @@ -230,6 +230,7 @@ private: double _tick_rate, _link_rate; bool _continuous_streaming; double _scaling_adjustment, _fxpt_scale_adj; + const boost::uint32_t _sid; }; rx_dsp_core_200::sptr rx_dsp_core_200::make(wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid, const bool lingering_packet){ -- cgit v1.2.3