aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/lib/usrp/e300/e300_impl.cpp4
-rw-r--r--host/lib/usrp/e300/e300_ublox_control_impl.cpp8
-rw-r--r--host/utils/query_gpsdo_sensors.cpp4
3 files changed, 12 insertions, 4 deletions
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp
index 76e0bc2e2..4f3b9866a 100644
--- a/host/lib/usrp/e300/e300_impl.cpp
+++ b/host/lib/usrp/e300/e300_impl.cpp
@@ -573,6 +573,10 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
}
_tree->access<subdev_spec_t>(mb_path / "rx_subdev_spec").set(rx_spec);
_tree->access<subdev_spec_t>(mb_path / "tx_subdev_spec").set(tx_spec);
+
+ UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl;
+ const time_t tp = time_t(_sensor_manager->get_sensor("gps_time").to_int()+1);
+ _tree->access<time_spec_t>(mb_path / "time" / "pps").set(time_spec_t(tp));
}
boost::uint8_t e300_impl::_get_internal_gpio(gpio_core_200::sptr gpio)
diff --git a/host/lib/usrp/e300/e300_ublox_control_impl.cpp b/host/lib/usrp/e300/e300_ublox_control_impl.cpp
index 0f56fdb67..389bf79fa 100644
--- a/host/lib/usrp/e300/e300_ublox_control_impl.cpp
+++ b/host/lib/usrp/e300/e300_ublox_control_impl.cpp
@@ -65,7 +65,10 @@ std::vector<std::string> control_impl::get_sensors(void)
uhd::sensor_value_t control_impl::get_sensor(std::string key)
{
if (key == "gps_time") {
- return sensor_value_t("GPS epoch time", int(_get_epoch_time()), "seconds");
+ bool lock;
+ _locked.wait_and_see(lock);
+ return sensor_value_t("GPS epoch time",
+ lock ? int(_get_epoch_time()) : 0, "seconds");
} else if (key == "gps_locked") {
bool lock;
_locked.wait_and_see(lock);
@@ -83,9 +86,6 @@ std::time_t control_impl::_get_epoch_time(void)
control_impl::~control_impl(void)
{
- // turn it all off again
- configure_antenna(0x001a, 0x8251);
- configure_pps(0xf4240, 0x3d090, 1, 1, 0, 0, 0, 0);
}
void control_impl::_decode_init(void)
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp
index 9a40d2b42..3b98a634c 100644
--- a/host/utils/query_gpsdo_sensors.cpp
+++ b/host/utils/query_gpsdo_sensors.cpp
@@ -101,11 +101,15 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}else
std::cout << boost::format("ref_locked sensor not present on this board.\n");
+ // Explicitly set time source to gpsdo
+ usrp->set_time_source("gpsdo");
+
//Check PPS and compare UHD device time to GPS time
boost::this_thread::sleep(boost::posix_time::seconds(1));
uhd::sensor_value_t gps_time = usrp->get_mboard_sensor("gps_time");
const time_t pc_clock_time = time(NULL);
const uhd::time_spec_t last_pps_time = usrp->get_time_last_pps();
+
if (last_pps_time.to_ticks(1.0) == gps_time.to_int()) {
std::cout << boost::format("GPS and UHD Device time are aligned.\n");
} else {