diff options
author | natetemple <nate.temple@ettus.com> | 2019-11-22 15:53:02 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-24 16:56:27 -0800 |
commit | d3e1d6e9be75ba8dcd21c2ed466b9e6a316625b0 (patch) | |
tree | 0125a624c517f0b72f555d550d6814c594320e57 /host | |
parent | 0e184f7185bd8645051535f23b5cc50a80bda296 (diff) | |
download | uhd-d3e1d6e9be75ba8dcd21c2ed466b9e6a316625b0.tar.gz uhd-d3e1d6e9be75ba8dcd21c2ed466b9e6a316625b0.tar.bz2 uhd-d3e1d6e9be75ba8dcd21c2ed466b9e6a316625b0.zip |
Examples: wrap up ref setting with option check
Diffstat (limited to 'host')
-rw-r--r-- | host/examples/replay_samples_from_file.cpp | 6 | ||||
-rw-r--r-- | host/examples/rx_ascii_art_dft.cpp | 4 | ||||
-rw-r--r-- | host/examples/rx_samples_to_file.cpp | 4 | ||||
-rw-r--r-- | host/examples/rx_samples_to_udp.cpp | 4 | ||||
-rw-r--r-- | host/examples/tx_samples_from_file.cpp | 4 | ||||
-rw-r--r-- | host/examples/tx_waveforms.cpp | 4 | ||||
-rw-r--r-- | host/examples/txrx_loopback_to_file.cpp | 8 |
7 files changed, 24 insertions, 10 deletions
diff --git a/host/examples/replay_samples_from_file.cpp b/host/examples/replay_samples_from_file.cpp index 9bd805ed8..1c0de27ba 100644 --- a/host/examples/replay_samples_from_file.cpp +++ b/host/examples/replay_samples_from_file.cpp @@ -123,8 +123,10 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) // Configure radio // Lock clocks - radio_ctrl->set_clock_source(ref); - + if (vm.count("ref")) { + radio_ctrl->set_clock_source(ref); + } + // Apply any radio arguments provided radio_ctrl->set_args(radio_args); diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp index 2f8c33947..3652522f2 100644 --- a/host/examples/rx_ascii_art_dft.cpp +++ b/host/examples/rx_ascii_art_dft.cpp @@ -71,7 +71,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); // Lock mboard clocks - usrp->set_clock_source(ref); + if (vm.count("ref")) { + usrp->set_clock_source(ref); + } // always select the subdevice first, the channel mapping affects the other settings if (vm.count("subdev")) diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp index 1eaa57a25..3a0fe5b5e 100644 --- a/host/examples/rx_samples_to_file.cpp +++ b/host/examples/rx_samples_to_file.cpp @@ -284,7 +284,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); // Lock mboard clocks - usrp->set_clock_source(ref); + if (vm.count("ref")) { + usrp->set_clock_source(ref); + } // always select the subdevice first, the channel mapping affects the other settings if (vm.count("subdev")) diff --git a/host/examples/rx_samples_to_udp.cpp b/host/examples/rx_samples_to_udp.cpp index a4deb9dcf..002d30ec4 100644 --- a/host/examples/rx_samples_to_udp.cpp +++ b/host/examples/rx_samples_to_udp.cpp @@ -65,7 +65,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl; // Lock mboard clocks - usrp->set_clock_source(ref); + if (vm.count("ref")) { + usrp->set_clock_source(ref); + } // always select the subdevice first, the channel mapping affects the other settings if (vm.count("subdev")) { diff --git a/host/examples/tx_samples_from_file.cpp b/host/examples/tx_samples_from_file.cpp index 382d42a40..7493718d2 100644 --- a/host/examples/tx_samples_from_file.cpp +++ b/host/examples/tx_samples_from_file.cpp @@ -103,7 +103,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); // Lock mboard clocks - usrp->set_clock_source(ref); + if (vm.count("ref")) { + usrp->set_clock_source(ref); + } // always select the subdevice first, the channel mapping affects the other settings if (vm.count("subdev")) diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 1bc762f57..173f339e2 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -104,7 +104,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) } // Lock mboard clocks - usrp->set_clock_source(ref); + if (vm.count("ref")) { + usrp->set_clock_source(ref); + } std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl; diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index d23e9a0d2..271d249f6 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -285,9 +285,11 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) } // Lock mboard clocks - tx_usrp->set_clock_source(ref); - rx_usrp->set_clock_source(ref); - + if (vm.count("ref")) { + tx_usrp->set_clock_source(ref); + rx_usrp->set_clock_source(ref); + } + std::cout << boost::format("Using TX Device: %s") % tx_usrp->get_pp_string() << std::endl; std::cout << boost::format("Using RX Device: %s") % rx_usrp->get_pp_string() |