aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-03-01 19:58:19 -0800
committerJosh Blum <josh@joshknows.com>2012-03-23 14:36:56 -0700
commitee04c245f142ae6637091076445d955108d4da62 (patch)
tree6b3fa343edf233197d4028d386c092db2251ad4c
parentb1d82758b0e98ab10c5ca2e65eed1ae90afd8d62 (diff)
downloaduhd-ee04c245f142ae6637091076445d955108d4da62.tar.gz
uhd-ee04c245f142ae6637091076445d955108d4da62.tar.bz2
uhd-ee04c245f142ae6637091076445d955108d4da62.zip
usrp2: permanent timeout increase for timed commands
-rw-r--r--host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
index e761e3d91..9d21c73ae 100644
--- a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
@@ -22,6 +22,7 @@
#include "usrp2_fifo_ctrl.hpp"
#include <boost/thread/mutex.hpp>
#include <boost/asio.hpp> //htonl
+#include <boost/format.hpp>
using namespace uhd::transport;
@@ -36,7 +37,8 @@ public:
usrp2_fifo_ctrl_impl(zero_copy_if::sptr xport):
_xport(xport),
- _seq(0), _last_seq_ack(0)
+ _seq(0), _last_seq_ack(0),
+ _timeout(ACK_TIMEOUT)
{
while (_xport->get_recv_buff(0.0)){} //flush
this->set_time(uhd::time_spec_t(0.0));
@@ -98,7 +100,7 @@ public:
boost::uint32_t wait_for_ack(const boost::int16_t seq_to_ack){
while (_last_seq_ack < seq_to_ack){
- managed_recv_buffer::sptr buff = _xport->get_recv_buff(_use_time? MASSIVE_TIMEOUT : ACK_TIMEOUT);
+ managed_recv_buffer::sptr buff = _xport->get_recv_buff(_timeout);
if (not buff){
throw uhd::runtime_error("fifo ctrl timed out looking for acks");
}
@@ -127,6 +129,7 @@ public:
boost::mutex::scoped_lock lock(_mutex);
_time = time;
_use_time = _time != uhd::time_spec_t(0.0);
+ if (_use_time) _timeout = MASSIVE_TIMEOUT; //permanently sets larger timeout
}
void set_tick_rate(const double rate){
@@ -142,6 +145,7 @@ private:
uhd::time_spec_t _time;
bool _use_time;
double _tick_rate;
+ double _timeout;
};