aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/tx_waveforms.cpp
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2018-06-11 12:48:13 -0700
committerMartin Braun <martin.braun@ettus.com>2018-06-12 06:48:59 -0700
commitc661c352ca30d6d6f04f33363022a7bd62094e41 (patch)
treecfddccf545752fb567a1ec7128b05eb297bab24a /host/examples/tx_waveforms.cpp
parent526929071a43b820e6ee45961e0a10e605862e91 (diff)
downloaduhd-c661c352ca30d6d6f04f33363022a7bd62094e41.tar.gz
uhd-c661c352ca30d6d6f04f33363022a7bd62094e41.tar.bz2
uhd-c661c352ca30d6d6f04f33363022a7bd62094e41.zip
examples: Select subdev spec before setting channels
Diffstat (limited to 'host/examples/tx_waveforms.cpp')
-rw-r--r--host/examples/tx_waveforms.cpp7
1 files changed, 3 insertions, 4 deletions
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<std::string> channel_strings;
std::vector<size_t> 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