aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2014-07-17 17:49:09 -0700
committerBen Hilburn <ben.hilburn@ettus.com>2014-07-17 17:49:09 -0700
commit4e8512abf885150404c2485e641d1bf02ea4ed24 (patch)
treeddfb295ba249259b3ef3f483ea9affd617deab98 /host/lib/usrp
parentdde82ff238b6fbdd2c49d62bf4ba75ef26cfbca8 (diff)
parent0db669b3ce4dc5ec6cd38d8d80159d9030393288 (diff)
downloaduhd-4e8512abf885150404c2485e641d1bf02ea4ed24.tar.gz
uhd-4e8512abf885150404c2485e641d1bf02ea4ed24.tar.bz2
uhd-4e8512abf885150404c2485e641d1bf02ea4ed24.zip
Merge branch 'origin/b200/bug512' into maint
B200 now creates internal PPS. Depends on FPGA change.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 261183128..ac2407eba 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -427,7 +427,7 @@ b200_impl::b200_impl(const device_addr_t &device_addr)
//setup time source props
_tree->create<std::string>(mb_path / "time_source" / "value")
.subscribe(boost::bind(&b200_impl::update_time_source, this, _1));
- static const std::vector<std::string> time_sources = boost::assign::list_of("none")("external")("gpsdo");
+ static const std::vector<std::string> time_sources = boost::assign::list_of("none")("internal")("external")("gpsdo");
_tree->create<std::vector<std::string> >(mb_path / "time_source" / "options").set(time_sources);
//setup reference source props
_tree->create<std::string>(mb_path / "clock_source" / "value")
@@ -464,10 +464,6 @@ b200_impl::b200_impl(const 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);
- //init to internal clock and time source
- _tree->access<std::string>(mb_path / "clock_source/value").set("internal");
- _tree->access<std::string>(mb_path / "time_source/value").set("none");
-
//GPS installed: use external ref, time, and init time spec
if (_gps and _gps->gps_detected())
{
@@ -477,6 +473,10 @@ b200_impl::b200_impl(const device_addr_t &device_addr)
UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl;
const time_t tp = time_t(_gps->get_sensor("gps_time").to_int()+1);
_tree->access<time_spec_t>(mb_path / "time" / "pps").set(time_spec_t(tp));
+ } else {
+ //init to internal clock and time source
+ _tree->access<std::string>(mb_path / "clock_source/value").set("internal");
+ _tree->access<std::string>(mb_path / "time_source/value").set("internal");
}
}
@@ -786,11 +786,17 @@ void b200_impl::update_clock_source(const std::string &source)
void b200_impl::update_time_source(const std::string &source)
{
- if (source == "none"){}
- else if (source == "external"){}
- else if (source == "gpsdo"){}
+ boost::uint32_t value = 0;
+ if (source == "none")
+ value = 3;
+ else if (source == "internal")
+ value = 2;
+ else if (source == "external")
+ value = 1;
+ else if (source == "gpsdo")
+ value = 0;
else throw uhd::key_error("update_time_source: unknown source: " + source);
- _local_ctrl->poke32(TOREG(SR_CORE_PPS_SEL), (source == "external")? 1 : 0);
+ _local_ctrl->poke32(TOREG(SR_CORE_PPS_SEL), value);
}
/***********************************************************************