diff options
author | Josh Blum <josh@joshknows.com> | 2012-05-30 12:59:18 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-05-30 12:59:18 -0700 |
commit | b61a11031fb21bc3f917574660279d54e4a8643e (patch) | |
tree | 6f8584e79ffd162eb51d2351369a7fe70a9d4016 | |
parent | bfe3233709b5341831bf3d695e8c130f9590a783 (diff) | |
parent | 3adecd5bc10c09fb5e66f4bb9422eb8936fd8668 (diff) | |
download | uhd-b61a11031fb21bc3f917574660279d54e4a8643e.tar.gz uhd-b61a11031fb21bc3f917574660279d54e4a8643e.tar.bz2 uhd-b61a11031fb21bc3f917574660279d54e4a8643e.zip |
Merge branch 'maint'
-rw-r--r-- | host/examples/tx_bursts.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.hpp | 7 |
2 files changed, 11 insertions, 10 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; diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index 86c1d8b27..bdef50ec1 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright 2010-2011 Ettus Research LLC +// Copyright 2010-2012 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include <uhd/usrp/dboard_eeprom.hpp> #include <uhd/usrp/dboard_manager.hpp> #include <uhd/transport/usb_zero_copy.hpp> +#include <boost/foreach.hpp> #include <boost/weak_ptr.hpp> #include <complex> @@ -143,6 +144,10 @@ private: void enable_tx(bool enb){ _tx_enabled = enb; _fx2_ctrl->usrp_tx_enable(enb); + BOOST_FOREACH(const std::string &key, _dbc.keys()) + { + _dbc[key].codec->enable_tx_digital(enb); + } } //conditionally disable and enable rx |