aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-07-14 14:51:14 -0700
committerMartin Braun <martin.braun@ettus.com>2015-07-14 14:51:14 -0700
commit7c6bc34f625e3945458a0a2a281850513a02ef08 (patch)
tree0e34c196d4aceae4cae6d7e22708ded67f558c31 /host/examples
parentbb940ccabb94daa685b4869f44c00844eeeb905b (diff)
parent5f4470a8fb340677f2d0b557f4670bc7506fc38a (diff)
downloaduhd-7c6bc34f625e3945458a0a2a281850513a02ef08.tar.gz
uhd-7c6bc34f625e3945458a0a2a281850513a02ef08.tar.bz2
uhd-7c6bc34f625e3945458a0a2a281850513a02ef08.zip
Merge branch 'maint'
Conflicts: fpga-src host/CMakeLists.txt host/cmake/Modules/UHDVersion.cmake host/lib/usrp/b200/b200_impl.hpp host/lib/usrp/e300/e300_fpga_defs.hpp host/lib/usrp/x300/x300_fw_common.h
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/tx_waveforms.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 9254c3b24..942b5df7b 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -178,15 +178,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::vector<std::complex<float> > buff(spb);
std::vector<std::complex<float> *> buffs(channel_nums.size(), &buff.front());
- //setup the metadata flags
- uhd::tx_metadata_t md;
- md.start_of_burst = true;
- md.end_of_burst = false;
- md.has_time_spec = true;
- md.time_spec = uhd::time_spec_t(0.1);
-
std::cout << boost::format("Setting device timestamp to 0...") << std::endl;
- usrp->set_time_now(uhd::time_spec_t(0.0));
+ if (channel_nums.size() > 1) {
+ // This is the worst-case setup scenario, because this example has to
+ // work for all configurations. set_time_now() and set_time_next_pps()
+ // might also work, depending on what USRPs are being used, and can
+ // accelerate the setup. To keep this example generic, we use
+ // set_time_unknown_pps() to guarantee synchronization.
+ usrp->set_time_unknown_pps(uhd::time_spec_t(0.0));
+ } else {
+ usrp->set_time_now(uhd::time_spec_t(0.0));
+ }
//Check Ref and LO Lock detect
std::vector<std::string> sensor_names;
@@ -211,6 +213,14 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::signal(SIGINT, &sig_int_handler);
std::cout << "Press Ctrl + C to stop streaming..." << std::endl;
+ // Set up metadata. We start streaming a bit in the future
+ // to allow MIMO operation:
+ uhd::tx_metadata_t md;
+ md.start_of_burst = true;
+ md.end_of_burst = false;
+ md.has_time_spec = true;
+ md.time_spec = usrp->get_time_now() + uhd::time_spec_t(0.1);
+
//send data until the signal handler gets called
while(not stop_signal_called){
//fill the buffer with the waveform