diff options
author | Nick Foster <nick@nerdnetworks.org> | 2011-01-25 14:12:39 -0800 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2011-01-25 14:12:39 -0800 |
commit | bf25ec24adc6e4d1aa563962452630628dad3215 (patch) | |
tree | 6b2ced9a933e661569f3cf45305043f00a601096 /host/lib | |
parent | c09d14c1b0546f9fc2d8263047c8822f220df3f8 (diff) | |
download | uhd-bf25ec24adc6e4d1aa563962452630628dad3215.tar.gz uhd-bf25ec24adc6e4d1aa563962452630628dad3215.tar.bz2 uhd-bf25ec24adc6e4d1aa563962452630628dad3215.zip |
N210: longer GPS timeout, removed try/catch in safe_recv loop (since it can't throw any more)
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/gps_ctrl.cpp | 16 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp | 6 |
2 files changed, 7 insertions, 15 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp index 3c7c00134..b1062fa39 100644 --- a/host/lib/usrp/gps_ctrl.cpp +++ b/host/lib/usrp/gps_ctrl.cpp @@ -58,7 +58,7 @@ public: if(trim_right_copy(reply) == "Command Error") { gps_type = GPS_TYPE_JACKSON_LABS; break; - } + } else if(reply.substr(0, 3) == "$GP") i_heard_some_nmea = true; //but keep looking for that "Command Error" response else if(reply.length() != 0) i_heard_something_weird = true; //probably wrong baud rate boost::this_thread::sleep(boost::posix_time::milliseconds(200)); @@ -104,6 +104,7 @@ public: found_gprmc = true; break; } + boost::this_thread::sleep(boost::posix_time::milliseconds(200)); } if(!found_gprmc) { if(gps_type == GPS_TYPE_JACKSON_LABS) std::cout << "Firefly GPS not locked or warming up." << std::endl; @@ -127,16 +128,7 @@ public: //TODO: this isn't generalizeable to non-USRP2 USRPs. std::string safe_gps_read() { - std::string reply; - try { - reply = _recv(); - } catch (std::runtime_error err) { - if(err.what() != std::string("usrp2 no control response")) throw; //sorry can't cope with that - else { //we don't actually have a GPS installed - reply = std::string(); - } - } - return reply; + return _recv(); } ptime get_time(void) { @@ -196,7 +188,7 @@ private: GPS_TYPE_NONE } gps_type; - static const int GPS_TIMEOUT_TRIES = 5; + static const int GPS_TIMEOUT_TRIES = 10; static const int GPS_TIMEOUT_DELAY_MS = 200; static const int FIREFLY_STUPID_DELAY_MS = 200; diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 95f7013e7..ee7ad99c5 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -66,9 +66,9 @@ usrp2_mboard_impl::usrp2_mboard_impl( //contruct the interfaces to mboard perifs _clock_ctrl = usrp2_clock_ctrl::make(_iface); _codec_ctrl = usrp2_codec_ctrl::make(_iface); - //_gps_ctrl = gps_ctrl::make( - // _iface->get_gps_write_fn(), - // _iface->get_gps_read_fn()); +// _gps_ctrl = gps_ctrl::make( +// _iface->get_gps_write_fn(), +// _iface->get_gps_read_fn()); //if(_gps_ctrl->gps_detected()) std::cout << "GPS time: " << _gps_ctrl->get_time() << std::endl; |