From 9030fb71746966a9ef6eb6ae2dc0aebdc6016987 Mon Sep 17 00:00:00 2001 From: jblum Date: Tue, 17 Feb 2009 23:03:39 +0000 Subject: usrp methods for computing the mux for dual subdevices git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10457 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/src/grc_gnuradio/usrp/dual_usrp.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'grc/src/grc_gnuradio/usrp/dual_usrp.py') diff --git a/grc/src/grc_gnuradio/usrp/dual_usrp.py b/grc/src/grc_gnuradio/usrp/dual_usrp.py index 47449ae78..f12b5348d 100644 --- a/grc/src/grc_gnuradio/usrp/dual_usrp.py +++ b/grc/src/grc_gnuradio/usrp/dual_usrp.py @@ -42,16 +42,11 @@ class _dual_source(gr.hier_block2): ) #create usrp object self._make_usrp(which=which, nchan=2) - #get the mux for side A subdev_spec_a = common.to_spec('A', rx_ant_a) - self._subdev_a = usrp.selected_subdev(self._get_u(), subdev_spec_a) - mux_a = usrp.determine_rx_mux_value(self._get_u(), subdev_spec_a) - #get the mux for side B subdev_spec_b = common.to_spec('B', rx_ant_b) - self._subdev_b = usrp.selected_subdev(self._get_u(), subdev_spec_b) - mux_b = usrp.determine_rx_mux_value(self._get_u(), subdev_spec_b) - #move the lower byte of the mux b into the second byte of the mux a - self._get_u().set_mux(((mux_b & 0xff) << 8) | (mux_a - (mux_a & 0xff00))) + self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec_a, subdev_spec_b)) + self._subdev_a = self._get_u().selected_subdev(subdev_spec_a) + self._subdev_b = self._get_u().selected_subdev(subdev_spec_b) #connect deinter = gr.deinterleave(self._get_io_size()) self.connect(self._get_u(), deinter) @@ -97,16 +92,11 @@ class _dual_sink(gr.hier_block2): ) #create usrp object self._make_usrp(which=which, nchan=2) - #get the mux for side A subdev_spec_a = common.to_spec('A') - self._subdev_a = usrp.selected_subdev(self._get_u(), subdev_spec_a) - mux_a = usrp.determine_tx_mux_value(self._get_u(), subdev_spec_a) - #get the mux for side B subdev_spec_b = common.to_spec('B') - self._subdev_b = usrp.selected_subdev(self._get_u(), subdev_spec_b) - mux_b = usrp.determine_tx_mux_value(self._get_u(), subdev_spec_b) - #set the mux - self._get_u().set_mux(mux_a | mux_b) + self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec_a, subdev_spec_b)) + self._subdev_a = self._get_u().selected_subdev(subdev_spec_a) + self._subdev_b = self._get_u().selected_subdev(subdev_spec_b) #connect inter = gr.interleave(self._get_io_size()) self.connect(inter, self._get_u()) -- cgit