From 19e3114defa259f7fd941d46a6f6002db6b8a0de Mon Sep 17 00:00:00 2001 From: jblum Date: Tue, 17 Feb 2009 02:33:08 +0000 Subject: kludge the legacy: usrp subdevice 2, the 3rd subdevice git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10448 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-core/src/python/gnuradio/eng_option.py | 6 +- .../platforms/python/blocks/usrp_dual_source_x.xml | 76 ++++++++-------------- .../python/blocks/usrp_simple_source_x.xml | 10 +-- grc/src/grc_gnuradio/usrp/common.py | 13 ++-- grc/src/grc_gnuradio/usrp/dual_usrp.py | 12 ++-- usrp/host/lib/legacy/db_basic.cc | 2 +- usrp/host/lib/legacy/db_boards.cc | 2 + usrp/host/lib/legacy/usrp_standard.cc | 30 ++++----- 8 files changed, 62 insertions(+), 89 deletions(-) diff --git a/gnuradio-core/src/python/gnuradio/eng_option.py b/gnuradio-core/src/python/gnuradio/eng_option.py index 40367d0d6..09c3e1d87 100644 --- a/gnuradio-core/src/python/gnuradio/eng_option.py +++ b/gnuradio-core/src/python/gnuradio/eng_option.py @@ -63,13 +63,13 @@ def check_subdev (option, opt, value): @returns a 2-tuple (0|1, 0|1) """ - d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), - 'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1) } + d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), 'A:2' : (0, 2), + 'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1), 'B:2' : (1, 2) } try: return d[value.upper()] except: raise OptionValueError( - "option %s: invalid subdev: '%r', must be one of A, B, A:0, A:1, B:0, B:1" % (opt, value)) + "option %s: invalid subdev: '%r', must be one of %s" % (opt, value, ', '.join(sorted(d.keys())))) class eng_option (Option): TYPES = Option.TYPES + ("eng_float", "intx", "subdev") diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml index c37ae877c..7d510f7be 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml @@ -8,7 +8,7 @@ USRP Dual Source usrp_dual_source_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_source_$(type.fcn)(which=$which, side_a='$rx_ant_a.side', rx_ant_a='$rx_ant_a.rx_ant', side_b='$rx_ant_b.side', rx_ant_b='$rx_ant_b.rx_ant') + grc_usrp.dual_source_$(type.fcn)(which=$which, rx_ant_a='$rx_ant_a', rx_ant_b='$rx_ant_b') #if $format.eval self.$(id).set_format(width=$format.width, shift=$format.shift) #end if @@ -97,39 +97,29 @@ self.$(id).set_gain_b($gain_b) rx_ant_a enum