From 6ff4100f0cc40fd31277672b89090ee744914c34 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 11 Mar 2012 18:35:52 -0700 Subject: fifo ctrl: implement timed command feature detection --- host/lib/usrp/multi_usrp.cpp | 3 +++ host/lib/usrp/usrp2/usrp2_impl.cpp | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index fd556c9f8..e2efa9a00 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -358,6 +358,9 @@ public: void set_command_time(const time_spec_t &time_spec, size_t mboard){ if (mboard != ALL_MBOARDS){ + if (not _tree->exists(mb_root(mboard) / "time/cmd")){ + throw uhd::not_implemented_error("timed command feature not implemented on this hardware"); + } _tree->access(mb_root(mboard) / "time/cmd").set(time_spec); return; } diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index ec6a82572..2e3d1e479 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -579,8 +579,15 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ static const std::vector clock_sources = boost::assign::list_of("internal")("external")("mimo"); _tree->create >(mb_path / "clock_source/options").set(clock_sources); //plug timed commands into tree here - _tree->create(mb_path / "time/cmd") - .subscribe(boost::bind(&usrp2_fifo_ctrl::set_time, _mbc[mb].fifo_ctrl, _1)); + switch(_mbc[mb].iface->get_rev()){ + case usrp2_iface::USRP_N200: + case usrp2_iface::USRP_N210: + case usrp2_iface::USRP_N200_R4: + case usrp2_iface::USRP_N210_R4: + _tree->create(mb_path / "time/cmd") + .subscribe(boost::bind(&usrp2_fifo_ctrl::set_time, _mbc[mb].fifo_ctrl, _1)); + default: break; //otherwise, do not register + } _tree->access(mb_path / "tick_rate") .subscribe(boost::bind(&usrp2_fifo_ctrl::set_tick_rate, _mbc[mb].fifo_ctrl, _1)); -- cgit v1.2.3