diff --git a/grc/gen_bladerf_blocks.py b/grc/gen_bladerf_blocks.py index b891acfb3149d508463fb84c3e900464612ad2a7..34856402f19350f3ffdfb7b34ef2266b563b0179 100644 --- a/grc/gen_bladerf_blocks.py +++ b/grc/gen_bladerf_blocks.py @@ -87,11 +87,18 @@ parameters: options: [False, True] option_labels: ['Disable', 'Enable'] +- id: use_dac + label: 'Use VCXTO DAC' + dtype: enum + default: False + options: ['False', 'True'] + hide: part - id: dac label: 'VCXTO DAC' dtype: real default: 10000 + hide: ${'$'}{ 'none' if use_dac == 'True' else 'part'} - id: xb200 category: x40/x115 @@ -181,6 +188,7 @@ templates: + ",ref_clk=" + str(int(${'$'}{ref_clk})) + ",in_clk=" + '${'$'}{in_clk}' + ",out_clk=" + str(${'$'}{out_clk}) + + ",use_dac=" + '${'$'}{use_dac}' + ",dac=" + str(${'$'}{dac}) + ",xb200=" + '${'$'}{xb200}' + ",tamer=" + '${'$'}{tamer}' diff --git a/lib/bladerf/bladerf_common.cc b/lib/bladerf/bladerf_common.cc index d32f71cafe23900268357fbdea8ca51dc708485e..ab38a6f75c71c55870663e5970021ceada790f44 100644 --- a/lib/bladerf/bladerf_common.cc +++ b/lib/bladerf/bladerf_common.cc @@ -309,7 +309,9 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction) } else { - if (dict.count("dac")) { + if (dict.count("dac") + && dict.count("use_dac") + && _get(dict, "use_dac") == "True") { init_dac(boost::lexical_cast<uint16_t>(_get(dict, "dac"))); } }