From c661c352ca30d6d6f04f33363022a7bd62094e41 Mon Sep 17 00:00:00 2001 From: Sugandha Gupta Date: Mon, 11 Jun 2018 12:48:13 -0700 Subject: examples: Select subdev spec before setting channels --- host/examples/tx_waveforms.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'host') diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index e1b55eb1a..a002720ee 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -80,6 +80,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl; uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); + //always select the subdevice first, the channel mapping affects the other settings + if (vm.count("subdev")) usrp->set_tx_subdev_spec(subdev); + //detect which channels to use std::vector channel_strings; std::vector channel_nums; @@ -92,13 +95,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ channel_nums.push_back(std::stoi(channel_strings[ch])); } - //Lock mboard clocks usrp->set_clock_source(ref); - //always select the subdevice first, the channel mapping affects the other settings - if (vm.count("subdev")) usrp->set_tx_subdev_spec(subdev); - std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl; //set the sample rate -- cgit v1.2.3