From 80dbdef7305da9028ba3747e79774dbb158a5d55 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 9 Oct 2011 20:28:48 -0700 Subject: b100: add reference lock sensor --- host/lib/usrp/b100/b100_impl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/b100/b100_impl.cpp') diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp index 5e36a19dd..591a8b49f 100644 --- a/host/lib/usrp/b100/b100_impl.cpp +++ b/host/lib/usrp/b100/b100_impl.cpp @@ -275,8 +275,8 @@ b100_impl::b100_impl(const device_addr_t &device_addr){ //////////////////////////////////////////////////////////////////// // and do the misc mboard sensors //////////////////////////////////////////////////////////////////// - //none for now... - _tree->create(mb_path / "sensors"); //phony property so this dir exists + _tree->create(mb_path / "sensors/ref_locked") + .publish(boost::bind(&b100_impl::get_ref_locked, this)); //////////////////////////////////////////////////////////////////// // create frontend control objects @@ -491,3 +491,8 @@ void b100_impl::enable_gpif(const bool en) { void b100_impl::clear_fpga_fifo(void) { _fx2_ctrl->usrp_control_write(VRQ_CLEAR_FPGA_FIFO, 0, 0, 0, 0); } + +sensor_value_t b100_impl::get_ref_locked(void){ + const bool lock = _clock_ctrl->get_locked(); + return sensor_value_t("Ref", lock, "locked", "unlocked"); +} -- cgit v1.2.3