diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/usrp_e/CMakeLists.txt | 3 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/fpga-downloader.cc | 3 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/usrp_e_impl.cpp | 16 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/usrp_e_impl.hpp | 7 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e/usrp_e_none.cpp | 38 |
5 files changed, 14 insertions, 53 deletions
diff --git a/host/lib/usrp/usrp_e/CMakeLists.txt b/host/lib/usrp/usrp_e/CMakeLists.txt index 568fbd132..db6d162d4 100644 --- a/host/lib/usrp/usrp_e/CMakeLists.txt +++ b/host/lib/usrp/usrp_e/CMakeLists.txt @@ -59,7 +59,4 @@ IF(HAVE_USRP_E_REQUIRED_HEADERS) ) ELSE(HAVE_USRP_E_REQUIRED_HEADERS) MESSAGE(STATUS " Skipping usrp-e support.") - LIBUHD_APPEND_SOURCES( - ${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e/usrp_e_none.cpp - ) ENDIF(HAVE_USRP_E_REQUIRED_HEADERS) diff --git a/host/lib/usrp/usrp_e/fpga-downloader.cc b/host/lib/usrp/usrp_e/fpga-downloader.cc index 4429786a9..ff8671e98 100644 --- a/host/lib/usrp/usrp_e/fpga-downloader.cc +++ b/host/lib/usrp/usrp_e/fpga-downloader.cc @@ -246,8 +246,7 @@ int main(int argc, char *argv[]) } */ -#include <uhd/usrp/usrp_e.hpp> -void uhd::usrp::usrp_e::load_fpga(const std::string &bin_file){ +void usrp_e_load_fpga(const std::string &bin_file){ gpio gpio_prog_b(PROG_B, OUT); gpio gpio_init_b(INIT_B, IN); gpio gpio_done (DONE, IN); diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.cpp b/host/lib/usrp/usrp_e/usrp_e_impl.cpp index a534c74b2..76c77af15 100644 --- a/host/lib/usrp/usrp_e/usrp_e_impl.cpp +++ b/host/lib/usrp/usrp_e/usrp_e_impl.cpp @@ -27,10 +27,6 @@ using namespace uhd; using namespace uhd::usrp; namespace fs = boost::filesystem; -UHD_STATIC_BLOCK(register_usrp_e_device){ - device::register_device(&usrp_e::find, &usrp_e::make); -} - /*********************************************************************** * Helper Functions **********************************************************************/ @@ -41,7 +37,7 @@ static std::string abs_path(const std::string &file_path){ /*********************************************************************** * Discovery **********************************************************************/ -device_addrs_t usrp_e::find(const device_addr_t &hint){ +static device_addrs_t usrp_e_find(const device_addr_t &hint){ device_addrs_t usrp_e_addrs; //return an empty list of addresses when type is set to non-usrp-e @@ -51,7 +47,7 @@ device_addrs_t usrp_e::find(const device_addr_t &hint){ if (not hint.has_key("node")){ device_addr_t new_addr = hint; new_addr["node"] = "/dev/usrp_e0"; - return usrp_e::find(new_addr); + return usrp_e_find(new_addr); } //use the given device node name @@ -68,8 +64,12 @@ device_addrs_t usrp_e::find(const device_addr_t &hint){ /*********************************************************************** * Make **********************************************************************/ -device::sptr usrp_e::make(const device_addr_t &device_addr){ - return sptr(new usrp_e_impl(device_addr["node"])); +static device::sptr usrp_e_make(const device_addr_t &device_addr){ + return device::sptr(new usrp_e_impl(device_addr["node"])); +} + +UHD_STATIC_BLOCK(register_usrp_e_device){ + device::register_device(&usrp_e_find, &usrp_e_make); } /*********************************************************************** diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.hpp b/host/lib/usrp/usrp_e/usrp_e_impl.hpp index 487e295cb..e6bea1358 100644 --- a/host/lib/usrp/usrp_e/usrp_e_impl.hpp +++ b/host/lib/usrp/usrp_e/usrp_e_impl.hpp @@ -18,8 +18,8 @@ #include "usrp_e_iface.hpp" #include "clock_ctrl.hpp" #include "codec_ctrl.hpp" +#include <uhd/device.hpp> #include <uhd/utils/pimpl.hpp> -#include <uhd/usrp/usrp_e.hpp> #include <uhd/usrp/dboard_eeprom.hpp> #include <uhd/types/clock_config.hpp> #include <uhd/types/stream_cmd.hpp> @@ -28,7 +28,10 @@ #ifndef INCLUDED_USRP_E_IMPL_HPP #define INCLUDED_USRP_E_IMPL_HPP -static const double MASTER_CLOCK_RATE = 64e6; +static const double MASTER_CLOCK_RATE = 64e6; //TODO get from clock control + +//! load an fpga image from a bin file into the usrp-e fpga +extern void usrp_e_load_fpga(const std::string &bin_file); /*! * Make a usrp-e dboard interface. diff --git a/host/lib/usrp/usrp_e/usrp_e_none.cpp b/host/lib/usrp/usrp_e/usrp_e_none.cpp deleted file mode 100644 index 09a3c6946..000000000 --- a/host/lib/usrp/usrp_e/usrp_e_none.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// Copyright 2010 Ettus Research LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// - -#include <uhd/usrp/usrp_e.hpp> - -using namespace uhd; -using namespace uhd::usrp; - -/*! - * This file defines the usrp1e discover and make functions - * when the required kernel module headers are not present. - */ - -device_addrs_t usrp_e::find(const device_addr_t &){ - return device_addrs_t(); //return empty list -} - -device::sptr usrp_e::make(const device_addr_t &){ - throw std::runtime_error("this build has no usrp1e support"); -} - -void usrp_e::load_fpga(const std::string &){ - throw std::runtime_error("this build has no usrp1e support"); -} |