diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-30 10:14:14 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-30 10:14:14 -0700 |
commit | f4dc4bf74e65d185ef76e48d3cb172bf0a66f24a (patch) | |
tree | 855c4907c02dd145f76ebd3c902fa3538483f90b /host/lib/usrp/b100/b100_ctrl.cpp | |
parent | bc9c9f551a2b8c3bdab4e61c0d63f8377694da2c (diff) | |
download | uhd-f4dc4bf74e65d185ef76e48d3cb172bf0a66f24a.tar.gz uhd-f4dc4bf74e65d185ef76e48d3cb172bf0a66f24a.tar.bz2 uhd-f4dc4bf74e65d185ef76e48d3cb172bf0a66f24a.zip |
b100: some tweaks (unresolved streaming issues ATM)
Diffstat (limited to 'host/lib/usrp/b100/b100_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/b100/b100_ctrl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/host/lib/usrp/b100/b100_ctrl.cpp b/host/lib/usrp/b100/b100_ctrl.cpp index be576cc99..22512f413 100644 --- a/host/lib/usrp/b100/b100_ctrl.cpp +++ b/host/lib/usrp/b100/b100_ctrl.cpp @@ -178,11 +178,18 @@ ctrl_data_t b100_ctrl_impl::read(boost::uint32_t addr, size_t len) { pkt.pkt_meta.addr = addr; boost::uint16_t pkt_buff[CTRL_PACKET_LENGTH / sizeof(boost::uint16_t)]; + //flush anything that might be in the queue + while (get_ctrl_data(pkt.data, 0.0)){ + UHD_MSG(error) << "B100: control read found unexpected packet." << std::endl; + } + pack_ctrl_pkt(pkt_buff, pkt); send_pkt(pkt_buff); - //loop around waiting for the response to appear - while(!get_ctrl_data(pkt.data, 0.05)); + //block with timeout waiting for the response to appear + if (not get_ctrl_data(pkt.data, 0.1)) throw uhd::runtime_error( + "B100: timeout waiting for control response packet." + ); return pkt.data; } |