summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-15 14:37:26 -0700
committerJosh Blum <josh@joshknows.com>2010-10-15 14:37:26 -0700
commit972fae172ae30323ed57795ca5a4aad790bac7f9 (patch)
tree87fbc7049c975f23cf7bb10b8c78123f64037b61 /host/lib
parent52229e99c90966c392f8ec74752912e3f00eec1d (diff)
downloaduhd-972fae172ae30323ed57795ca5a4aad790bac7f9.tar.gz
uhd-972fae172ae30323ed57795ca5a4aad790bac7f9.tar.bz2
uhd-972fae172ae30323ed57795ca5a4aad790bac7f9.zip
usrp2: temp fix to send dummy packets and flush so FPGA vita machine are in known state
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 8314cf9ae..00061ae47 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -241,6 +241,8 @@ void usrp2_impl::io_impl::recv_pirate_loop(
/***********************************************************************
* Helper Functions
**********************************************************************/
+#include <uhd/usrp/mboard_props.hpp> //TODO remove when hack below is fixed
+
void usrp2_impl::io_init(void){
//the assumption is that all data transports should be identical
@@ -250,6 +252,30 @@ void usrp2_impl::io_init(void){
//create new io impl
_io_impl = UHD_PIMPL_MAKE(io_impl, (num_recv_frames, send_frame_size, _data_transports.size()));
+ //TODO temporary fix for weird power up state, remove when FPGA fixed
+ {
+ //send an initial packet to all transports
+ tx_metadata_t md; md.end_of_burst = true;
+ this->send(
+ std::vector<const void *>(_data_transports.size(), NULL), 0, md,
+ io_type_t::COMPLEX_FLOAT32, device::SEND_MODE_ONE_PACKET, 0
+ );
+
+ //issue a stream command to each motherboard
+ BOOST_FOREACH(usrp2_mboard_impl::sptr mboard, _mboards){
+ (*mboard)[MBOARD_PROP_STREAM_CMD] = stream_cmd_t(stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
+ (*mboard)[MBOARD_PROP_STREAM_CMD] = stream_cmd_t(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
+ }
+
+ //wait
+ boost::this_thread::sleep(boost::posix_time::milliseconds(100));
+
+ //flush all transport receive queues (no timeout)
+ BOOST_FOREACH(zero_copy_if::sptr xport, _data_transports){
+ while(xport->get_recv_buff(0).get() != NULL){};
+ }
+ }
+
//create a new pirate thread for each zc if (yarr!!)
for (size_t i = 0; i < _data_transports.size(); i++){
_io_impl->recv_pirate_crew.create_thread(boost::bind(