From f2b560d5f8d19bf6bbd86802e03f061ecede78ec Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 4 Jun 2010 12:16:09 -0700 Subject: Prepend usrp2 onto the helper classes in usrp2 impl to avoid symbol conflicts. --- host/lib/usrp/usrp2/usrp2_impl.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib/usrp/usrp2/usrp2_impl.hpp') diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 40c193866..90306a85f 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -43,7 +43,7 @@ */ uhd::usrp::dboard_iface::sptr make_usrp2_dboard_iface( usrp2_iface::sptr iface, - clock_ctrl::sptr clk_ctrl + usrp2_clock_ctrl::sptr clk_ctrl ); /*! @@ -134,9 +134,9 @@ private: //interfaces usrp2_iface::sptr _iface; - clock_ctrl::sptr _clock_ctrl; - codec_ctrl::sptr _codec_ctrl; - serdes_ctrl::sptr _serdes_ctrl; + usrp2_clock_ctrl::sptr _clock_ctrl; + usrp2_codec_ctrl::sptr _codec_ctrl; + usrp2_serdes_ctrl::sptr _serdes_ctrl; /******************************************************************* * Deal with the rx and tx packet sizes -- cgit v1.2.3 From 4f0736ef7ce93d58f0768d99257b2624d5711490 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 4 Jun 2010 12:32:06 -0700 Subject: move get clock rate into clock control --- host/lib/usrp/usrp2/clock_ctrl.cpp | 4 ++++ host/lib/usrp/usrp2/clock_ctrl.hpp | 6 ++++++ host/lib/usrp/usrp2/dboard_iface.cpp | 2 +- host/lib/usrp/usrp2/usrp2_iface.cpp | 7 ------- host/lib/usrp/usrp2/usrp2_iface.hpp | 6 ------ host/lib/usrp/usrp2/usrp2_impl.hpp | 4 ++-- 6 files changed, 13 insertions(+), 16 deletions(-) (limited to 'host/lib/usrp/usrp2/usrp2_impl.hpp') diff --git a/host/lib/usrp/usrp2/clock_ctrl.cpp b/host/lib/usrp/usrp2/clock_ctrl.cpp index 94920143d..d9baa66cf 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.cpp +++ b/host/lib/usrp/usrp2/clock_ctrl.cpp @@ -110,6 +110,10 @@ public: this->update_regs(); } + double get_master_clock_rate(void){ + return 100e6; + } + private: /*! * Write a single register to the spi regs. diff --git a/host/lib/usrp/usrp2/clock_ctrl.hpp b/host/lib/usrp/usrp2/clock_ctrl.hpp index 122b5e633..0ad8d9532 100644 --- a/host/lib/usrp/usrp2/clock_ctrl.hpp +++ b/host/lib/usrp/usrp2/clock_ctrl.hpp @@ -33,6 +33,12 @@ public: */ static sptr make(usrp2_iface::sptr iface); + /*! + * Get the master clock frequency for the fpga. + * \return the clock frequency in Hz + */ + virtual double get_master_clock_rate(void) = 0; + /*! * Enable/disable the rx dboard clock. * \param enb true to enable diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index 5933f8e40..feee0a970 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -117,7 +117,7 @@ usrp2_dboard_iface::~usrp2_dboard_iface(void){ * Clocks **********************************************************************/ double usrp2_dboard_iface::get_clock_rate(unit_t){ - return _iface->get_master_clock_freq(); + return _clock_ctrl->get_master_clock_rate(); } void usrp2_dboard_iface::set_clock_enabled(unit_t unit, bool enb){ diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index e12c84d45..6e0d3266a 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -166,13 +166,6 @@ public: throw std::runtime_error("usrp2 no control response"); } -/*********************************************************************** - * Master Clock! Ahhhhh - **********************************************************************/ - double get_master_clock_freq(void){ - return 100e6; - } - private: //this lovely lady makes it all possible transport::udp_simple::sptr _ctrl_transport; diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp index caf6623e2..7b2a3a89d 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.hpp +++ b/host/lib/usrp/usrp2/usrp2_iface.hpp @@ -108,12 +108,6 @@ public: size_t num_bits, bool readback ) = 0; - - /*! - * Get the master clock frequency. - * \return the frequency in Hz - */ - virtual double get_master_clock_freq(void) = 0; }; #endif /* INCLUDED_USRP2_IFACE_HPP */ diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 90306a85f..6ad151a0a 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -124,8 +124,8 @@ public: ); private: - double get_master_clock_freq(void){ - return _iface->get_master_clock_freq(); + inline double get_master_clock_freq(void){ + return _clock_ctrl->get_master_clock_rate(); } //device properties interface -- cgit v1.2.3