aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-02-10 16:41:50 -0800
committerMartin Braun <martin.braun@ettus.com>2017-02-10 16:41:50 -0800
commitcc769d1b532df2c636edca0bda951b3c5e919de2 (patch)
tree40322d9dbb0875e7fcd888aa375b2c7a6c5feb39 /host/lib/usrp
parent0e7c61ec6818232ffcb68b79e54d8ffbe7431d75 (diff)
parentd5d3e5a7cc4a8a5cbb1685f2e00d6301a9a9781f (diff)
downloaduhd-cc769d1b532df2c636edca0bda951b3c5e919de2.tar.gz
uhd-cc769d1b532df2c636edca0bda951b3c5e919de2.tar.bz2
uhd-cc769d1b532df2c636edca0bda951b3c5e919de2.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/gps_ctrl.cpp24
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp4
2 files changed, 20 insertions, 8 deletions
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp
index f4a42af34..447a13c33 100644
--- a/host/lib/usrp/gps_ctrl.cpp
+++ b/host/lib/usrp/gps_ctrl.cpp
@@ -203,13 +203,15 @@ public:
//first we look for an internal GPSDO
_flush(); //get whatever junk is in the rx buffer right now, and throw it away
+
_send("*IDN?\r\n"); //request identity from the GPSDO
//then we loop until we either timeout, or until we get a response that indicates we're a JL device
- const boost::system_time comm_timeout = boost::get_system_time() + milliseconds(GPS_COMM_TIMEOUT_MS);
+ //maximum response time was measured at ~320ms, so we set the timeout at 650ms
+ const boost::system_time comm_timeout = boost::get_system_time() + milliseconds(650);
while(boost::get_system_time() < comm_timeout) {
reply = _recv();
- //known devices are JL "FireFly" and "LC_XO"
+ //known devices are JL "FireFly", "GPSTCXO", and "LC_XO"
if(reply.find("FireFly") != std::string::npos
or reply.find("LC_XO") != std::string::npos
or reply.find("GPSTCXO") != std::string::npos) {
@@ -218,14 +220,22 @@ public:
} else if(reply.substr(0, 3) == "$GP") {
i_heard_some_nmea = true; //but keep looking
} else if(not reply.empty()) {
- i_heard_something_weird = true; //probably wrong baud rate
+ // wrong baud rate or firmware still initializing
+ i_heard_something_weird = true;
+ _send("*IDN?\r\n"); //re-send identity request
+ } else {
+ // _recv timed out
+ _send("*IDN?\r\n"); //re-send identity request
}
}
- if((i_heard_some_nmea) && (_gps_type != GPS_TYPE_INTERNAL_GPSDO)) _gps_type = GPS_TYPE_GENERIC_NMEA;
-
- if((_gps_type == GPS_TYPE_NONE) && i_heard_something_weird) {
- UHD_MSG(error) << "GPS invalid reply \"" << reply << "\", assuming none available" << std::endl;
+ if (_gps_type == GPS_TYPE_NONE)
+ {
+ if(i_heard_some_nmea) {
+ _gps_type = GPS_TYPE_GENERIC_NMEA;
+ } else if(i_heard_something_weird) {
+ UHD_MSG(error) << "GPS invalid reply \"" << reply << "\", assuming none available" << std::endl;
+ }
}
switch(_gps_type) {
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index aa54c2228..edf254130 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -1072,7 +1072,9 @@ x300_impl::~x300_impl(void)
release(mb.zpu_ctrl);
//If the process is killed, the entire registry will disappear so we
//don't need to worry about unclean shutdowns here.
- get_pcie_zpu_iface_registry().pop(mb.get_pri_eth().addr);
+ if (get_pcie_zpu_iface_registry().has_key(mb.get_pri_eth().addr)) {
+ get_pcie_zpu_iface_registry().pop(mb.get_pri_eth().addr);
+ }
}
}
}