summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorNick Foster <nick@ettus.com>2011-06-17 15:09:16 -0700
committerNick Foster <nick@ettus.com>2011-06-17 15:09:16 -0700
commit6f6364f73aad1262fdbe88ad97128f7844764c99 (patch)
treefd8f72d6143e7e543e4e62b2f4c7f9acf94efbb7 /host/lib/usrp/usrp2
parent7af605b247ee9331c29c23229252a101b7d40352 (diff)
downloaduhd-6f6364f73aad1262fdbe88ad97128f7844764c99.tar.gz
uhd-6f6364f73aad1262fdbe88ad97128f7844764c99.tar.bz2
uhd-6f6364f73aad1262fdbe88ad97128f7844764c99.zip
UHD: implemented gps_locked sensor. usrp2 mboard doesn't init VITA time if time not valid.
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 3733915a2..12fff96d0 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -149,7 +149,13 @@ usrp2_mboard_impl::usrp2_mboard_impl(
(_mimo_clocking_mode_is_master?"master":"slave") << std::endl;
//init the clock config
- _clock_config = clock_config_t::internal();
+ if(_iface->mb_eeprom["gpsdo"] == "internal" or
+ _iface->mb_eeprom["gpsdo"] == "external") {
+ _clock_config = clock_config_t::external();
+ }
+ else {
+ _clock_config = clock_config_t::internal();
+ }
update_clock_config();
//init the codec before the dboard
@@ -176,9 +182,15 @@ usrp2_mboard_impl::usrp2_mboard_impl(
//------------------------------------------------------------------
//initialize VITA time to GPS time
- if(_gps_ctrl.get() and _gps_ctrl->gps_detected()) {
- UHD_MSG(status) << "Setting device time to GPS time...\n";
- set_time_spec(time_spec_t(double(_gps_ctrl->get_sensor("gps_time").to_int()+1)), false);
+ if( _gps_ctrl.get()
+ and _gps_ctrl->gps_detected()) {
+ if(_gps_ctrl->get_sensor("gps_locked").to_bool()) {
+ UHD_MSG(status) << "Setting device time to GPS time...\n";
+ set_time_spec(time_spec_t(double(_gps_ctrl->get_sensor("gps_time").to_int()+1)), false);
+ }
+ else {
+ UHD_MSG(status) << "GPS not locked to satellites. Not initializing VITA time.";
+ }
}
}