diff options
author | Josh Blum <josh@joshknows.com> | 2012-05-30 12:51:26 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-05-30 12:51:26 -0700 |
commit | 7bcaacdbc7d58c06e69fe42806aedbbd5ad9d8d2 (patch) | |
tree | 866b99428bab8f99ccb793f5e5ac8312b7b43fa2 /host/examples | |
parent | 7f44d838c8d18314c4713ee3fc07faaaa01a6415 (diff) | |
download | uhd-7bcaacdbc7d58c06e69fe42806aedbbd5ad9d8d2.tar.gz uhd-7bcaacdbc7d58c06e69fe42806aedbbd5ad9d8d2.tar.bz2 uhd-7bcaacdbc7d58c06e69fe42806aedbbd5ad9d8d2.zip |
examples: fix tx bursts so we only set EOB at the end
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/tx_bursts.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp index 5a10ff81b..4cf5f2fd1 100644 --- a/host/examples/tx_bursts.cpp +++ b/host/examples/tx_bursts.cpp @@ -100,12 +100,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //allocate buffer with data to send const size_t spb = tx_stream->get_max_num_samps(); - std::vector<std::complex<float> *> buffs; - for(size_t i=0; i < usrp->get_num_mboards(); i++) { - buffs.push_back(new std::complex<float>[spb]); - for(size_t n=0; n < spb; n++) - buffs.back()[n] = std::complex<float>(ampl, ampl); - }; + std::vector<std::complex<float> > buff(spb, std::complex<float>(ampl, ampl)); + std::vector<std::complex<float> *> buffs(usrp->get_tx_num_channels(), &buff.front()); std::signal(SIGINT, &sig_int_handler); if(repeat) std::cout << "Press Ctrl + C to quit..." << std::endl; @@ -127,9 +123,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ while(num_acc_samps < total_num_samps){ size_t samps_to_send = std::min(total_num_samps - num_acc_samps, spb); - //ensure the the last packet has EOB set - md.end_of_burst = samps_to_send <= spb; - //send a single packet size_t num_tx_samps = tx_stream->send( buffs, samps_to_send, md, timeout @@ -145,6 +138,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ num_acc_samps += num_tx_samps; } + md.end_of_burst = true; + tx_stream->send(buffs, 0, md, timeout); + time_to_send += rep_rate; std::cout << std::endl << "Waiting for async burst ACK... " << std::flush; |