diff options
23 files changed, 88 insertions, 61 deletions
diff --git a/mpm/dboards/magnesium_manager.cpp b/mpm/dboards/magnesium_manager.cpp index 2411ef558..92f196a9f 100644 --- a/mpm/dboards/magnesium_manager.cpp +++ b/mpm/dboards/magnesium_manager.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "magnesium_manager.hpp" +#include "mpm/dboards/magnesium_manager.hpp" #include "mpm/spi/spidev_iface.hpp" #include <boost/make_shared.hpp> diff --git a/mpm/include/mpm/CMakeLists.txt b/mpm/include/mpm/CMakeLists.txt index d8ffe1416..348073920 100644 --- a/mpm/include/mpm/CMakeLists.txt +++ b/mpm/include/mpm/CMakeLists.txt @@ -15,6 +15,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # INSTALL(FILES - print_foo.hpp + net_helper.hpp + spi_iface.hpp + udev_helper.hpp + xbar_iface.hpp DESTINATION ${INCLUDE_DIR}/mpm ) diff --git a/mpm/dboards/magnesium_manager.hpp b/mpm/include/mpm/dboards/magnesium_manager.hpp index 3c8f038ed..356727618 100644 --- a/mpm/dboards/magnesium_manager.hpp +++ b/mpm/include/mpm/dboards/magnesium_manager.hpp @@ -17,10 +17,10 @@ #pragma once -#include "../lib/spi/spi_lock.h" +#include "mpm/spi/spi_lock.hpp" #include "mpm/spi/spidev_iface.hpp" -#include "lmk/lmk04828_spi_iface.hpp" -#include "../lib/mykonos/ad937x_ctrl.hpp" +#include "mpm/lmk04828/lmk04828_spi_iface.hpp" +#include "mpm/mykonos/ad937x_ctrl.hpp" #include <memory> namespace mpm { namespace dboards { diff --git a/mpm/include/lmk/lmk04828_spi_iface.hpp b/mpm/include/mpm/lmk04828/lmk04828_spi_iface.hpp index fa11029a8..fa11029a8 100644 --- a/mpm/include/lmk/lmk04828_spi_iface.hpp +++ b/mpm/include/mpm/lmk04828/lmk04828_spi_iface.hpp diff --git a/mpm/lib/mykonos/ad937x_ctrl.hpp b/mpm/include/mpm/mykonos/ad937x_ctrl.hpp index 12c165dab..663424b06 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.hpp +++ b/mpm/include/mpm/mykonos/ad937x_ctrl.hpp @@ -17,19 +17,19 @@ #pragma once -#include "ad937x_device.hpp" -#include "../spi/spi_lock.h" +#include "mpm/spi/spi_lock.hpp" // TODO: fix path of UHD includes -#include <../../host/include/uhd/types/direction.hpp> -#include <../../host/include/uhd/types/ranges.hpp> -#include <../../host/include/uhd/exception.hpp> -#include <../../host/include/uhd/types/serial.hpp> +#include <uhd/types/direction.hpp> +#include <uhd/types/ranges.hpp> +#include <uhd/exception.hpp> +#include <uhd/types/serial.hpp> #include <boost/noncopyable.hpp> #include <memory> #include <functional> #include <set> +class ad937x_device; class ad937x_ctrl : public boost::noncopyable { @@ -66,8 +66,6 @@ public: protected: static uhd::direction_t _get_direction_from_antenna(const std::string& antenna); - static ad937x_device::chain_t _get_chain_from_antenna(const std::string& antenna); - static std::set<size_t> _get_valid_fir_lengths(const std::string& which); }; diff --git a/mpm/lib/net_helper.hpp b/mpm/include/mpm/net_helper.hpp index b07e43ccc..b07e43ccc 100644 --- a/mpm/lib/net_helper.hpp +++ b/mpm/include/mpm/net_helper.hpp diff --git a/mpm/include/mpm/print_foo.hpp b/mpm/include/mpm/print_foo.hpp deleted file mode 100644 index d85ac5727..000000000 --- a/mpm/include/mpm/print_foo.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#include <iostream> - -namespace mpm{ - void print_foo(); -} diff --git a/mpm/lib/spi/mock_spi.h b/mpm/include/mpm/spi/mock_spi.h index c289faa16..c289faa16 100644 --- a/mpm/lib/spi/mock_spi.h +++ b/mpm/include/mpm/spi/mock_spi.h diff --git a/mpm/include/mpm/spi_iface.hpp b/mpm/include/mpm/spi/spi_iface.hpp index 3142fd661..3142fd661 100644 --- a/mpm/include/mpm/spi_iface.hpp +++ b/mpm/include/mpm/spi/spi_iface.hpp diff --git a/mpm/lib/spi/spi_lock.h b/mpm/include/mpm/spi/spi_lock.hpp index 9ad4e20fe..9ad4e20fe 100644 --- a/mpm/lib/spi/spi_lock.h +++ b/mpm/include/mpm/spi/spi_lock.hpp diff --git a/mpm/lib/udev_helper.hpp b/mpm/include/mpm/udev_helper.hpp index 055a93cee..055a93cee 100644 --- a/mpm/lib/udev_helper.hpp +++ b/mpm/include/mpm/udev_helper.hpp diff --git a/mpm/lib/xbar_iface.hpp b/mpm/include/mpm/xbar_iface.hpp index 9b17ed97b..9b17ed97b 100644 --- a/mpm/lib/xbar_iface.hpp +++ b/mpm/include/mpm/xbar_iface.hpp diff --git a/mpm/lib/CMakeLists.txt b/mpm/lib/CMakeLists.txt index 647697c84..649d944c9 100644 --- a/mpm/lib/CMakeLists.txt +++ b/mpm/lib/CMakeLists.txt @@ -28,5 +28,4 @@ USRP_PERIPHS_ADD_OBJECT(periphs net_helper.cpp udev_helper.cpp xbar_iface.cpp - print_foo.cpp ) diff --git a/mpm/lib/lmk04828/lmk04828_spi_iface.cpp b/mpm/lib/lmk04828/lmk04828_spi_iface.cpp index 2e3b43a3c..d0ae26063 100644 --- a/mpm/lib/lmk04828/lmk04828_spi_iface.cpp +++ b/mpm/lib/lmk04828/lmk04828_spi_iface.cpp @@ -1,7 +1,7 @@ -#include "lmk/lmk04828_spi_iface.hpp" -#include "uhd/exception.hpp" -#include <boost/bind.hpp> +#include <mpm/lmk04828/lmk04828_spi_iface.hpp> +#include <uhd/exception.hpp> #include <boost/make_shared.hpp> +#include <functional> lmk04828_spi_iface::lmk04828_spi_iface(uhd::spi_iface::sptr iface) : _spi_iface(iface) { @@ -11,12 +11,12 @@ lmk04828_spi_iface::lmk04828_spi_iface(uhd::spi_iface::sptr iface) : _spi_iface( lmk04828_iface::write_fn_t lmk04828_spi_iface::get_write_fn() { - return boost::bind(&lmk04828_spi_iface::spi_write, this, _1); + return std::bind(&lmk04828_spi_iface::spi_write, this, std::placeholders::_1); } lmk04828_iface::read_fn_t lmk04828_spi_iface::get_read_fn() { - return boost::bind(&lmk04828_spi_iface::spi_read, this, _1); + return std::bind(&lmk04828_spi_iface::spi_read, this, std::placeholders::_1); } void lmk04828_spi_iface::spi_write(std::vector<uint32_t> writes) { diff --git a/mpm/lib/mykonos/ad937x_ctrl.cpp b/mpm/lib/mykonos/ad937x_ctrl.cpp index 1aff4ed42..c4343a2e6 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.cpp +++ b/mpm/lib/mykonos/ad937x_ctrl.cpp @@ -16,7 +16,7 @@ // #include "ad937x_device.hpp" -#include "ad937x_ctrl.hpp" +#include "mpm/mykonos/ad937x_ctrl.hpp" #include "adi/mykonos.h" #include <sstream> @@ -85,21 +85,6 @@ uhd::direction_t ad937x_ctrl::_get_direction_from_antenna(const std::string& ant return uhd::direction_t::RX_DIRECTION; } -ad937x_device::chain_t ad937x_ctrl::_get_chain_from_antenna(const std::string& antenna) -{ - auto sub = antenna.substr(2, 1); - if (sub == "1") { - return ad937x_device::chain_t::ONE; - } - else if (sub == "2") { - return ad937x_device::chain_t::TWO; - } - else { - throw uhd::runtime_error("ad937x_ctrl got an invalid channel string."); - } - return ad937x_device::chain_t::ONE; -} - class ad937x_ctrl_impl : public ad937x_ctrl { public: @@ -110,6 +95,23 @@ public: } + static ad937x_device::chain_t _get_chain_from_antenna(const std::string& antenna) + { + auto sub = antenna.substr(2, 1); + if (sub == "1") { + return ad937x_device::chain_t::ONE; + } + else if (sub == "2") { + return ad937x_device::chain_t::TWO; + } + else { + throw uhd::runtime_error("ad937x_ctrl got an invalid channel string."); + } + return ad937x_device::chain_t::ONE; + } + + + virtual uint8_t get_product_id() { std::lock_guard<spi_lock> lock(*spi_l); diff --git a/mpm/lib/mykonos/ad937x_device.hpp b/mpm/lib/mykonos/ad937x_device.hpp index 52d25abba..4fedc05f0 100644 --- a/mpm/lib/mykonos/ad937x_device.hpp +++ b/mpm/lib/mykonos/ad937x_device.hpp @@ -24,9 +24,9 @@ #include "mpm/spi/adi_ctrl.hpp" // TODO: fix path of UHD includes -#include <../../host/include/uhd/types/direction.hpp> -#include <../../host/include/uhd/types/ranges.hpp> -#include <../../host/include/uhd/exception.hpp> +#include <uhd/types/direction.hpp> +#include <uhd/types/ranges.hpp> +#include <uhd/exception.hpp> #include <boost/noncopyable.hpp> #include <mutex> @@ -100,4 +100,4 @@ private: static uint8_t _convert_rx_gain(double gain); static uint16_t _convert_tx_gain(double gain); -};
\ No newline at end of file +}; diff --git a/mpm/lib/net_helper.cpp b/mpm/lib/net_helper.cpp index 0da8de3cf..a40fd742d 100644 --- a/mpm/lib/net_helper.cpp +++ b/mpm/lib/net_helper.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "net_helper.hpp" +#include <mpm/net_helper.hpp> #include <uhd/exception.hpp> #include <boost/format.hpp> #include <netdb.h> diff --git a/mpm/lib/print_foo.cpp b/mpm/lib/print_foo.cpp deleted file mode 100644 index 4f6d69775..000000000 --- a/mpm/lib/print_foo.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include <iostream> -#include <mpm/print_foo.hpp> - -void mpm::print_foo() -{ - std::cout << "foo" << std::endl; -} - diff --git a/mpm/lib/spi/spi_lock.cpp b/mpm/lib/spi/spi_lock.cpp index 5077053e7..b37daa738 100644 --- a/mpm/lib/spi/spi_lock.cpp +++ b/mpm/lib/spi/spi_lock.cpp @@ -1,4 +1,4 @@ -#include "spi_lock.h" +#include "mpm/spi/spi_lock.hpp" spi_lock::spi_lock(uint8_t spidev_index) : spidev_index(spidev_index) diff --git a/mpm/lib/udev_helper.cpp b/mpm/lib/udev_helper.cpp index ba12f6667..108b4b07a 100644 --- a/mpm/lib/udev_helper.cpp +++ b/mpm/lib/udev_helper.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "udev_helper.hpp" +#include "mpm/udev_helper.hpp" #include <uhd/exception.hpp> #include <boost/format.hpp> #include <boost/make_shared.hpp> diff --git a/mpm/lib/xbar_iface.cpp b/mpm/lib/xbar_iface.cpp index 21b60d131..8bd89533c 100644 --- a/mpm/lib/xbar_iface.cpp +++ b/mpm/lib/xbar_iface.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "xbar_iface.hpp" +#include "mpm/xbar_iface.hpp" #include <uhd/exception.hpp> #include <boost/format.hpp> #include <sys/ioctl.h> diff --git a/mpm/python/CMakeLists.txt b/mpm/python/CMakeLists.txt index 7a88abfc7..382f244c9 100644 --- a/mpm/python/CMakeLists.txt +++ b/mpm/python/CMakeLists.txt @@ -19,6 +19,44 @@ # This file included, use CMake directory variables ######################################################################## +######################################################################## +# Setup Boost +######################################################################## +MESSAGE(STATUS "") +MESSAGE(STATUS "Configuring Boost C++ Libraries...") +SET(BOOST_REQUIRED_COMPONENTS + python + system +) +IF(MINGW) + LIST(APPEND BOOST_REQUIRED_COMPONENTS thread_win32) +ELSE() + LIST(APPEND BOOST_REQUIRED_COMPONENTS thread) +ENDIF() + +IF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") + LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix +ENDIF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") + +IF(MSVC) + SET(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") + IF(BOOST_ALL_DYN_LINK) + ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc + ELSE(BOOST_ALL_DYN_LINK) + SET(BOOST_REQUIRED_COMPONENTS) #empty components list for static link + ENDIF(BOOST_ALL_DYN_LINK) +ENDIF(MSVC) + +SET(Boost_ADDITIONAL_VERSIONS + "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.48.0" "1.49" "1.50.0" "1.50" + "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55" + "1.56.0" "1.56" "1.57" "1.57" "1.58" "1.59" "1.60" "1.61" +) +FIND_PACKAGE(Boost 1.53 COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) + +MESSAGE(STATUS "Boost include directories: ${Boost_INCLUDE_DIRS}") +MESSAGE(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}") +MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}") SET(UHD_HOST_ROOT ${CMAKE_SOURCE_DIR}/../host) LIST(APPEND diff --git a/mpm/python/pyusrp_periphs.cpp b/mpm/python/pyusrp_periphs.cpp index 348e19c5c..397fab06a 100644 --- a/mpm/python/pyusrp_periphs.cpp +++ b/mpm/python/pyusrp_periphs.cpp @@ -27,11 +27,11 @@ //#include "types.hpp" #include "converters.hpp" -#include "net_helper.hpp" -#include "xbar_iface.hpp" -#include "udev_helper.hpp" -#include "mykonos/ad937x_ctrl.hpp" -#include "lmk/lmk04828_spi_iface.hpp" +#include "mpm/net_helper.hpp" +#include "mpm/xbar_iface.hpp" +#include "mpm/udev_helper.hpp" +#include "mpm/mykonos/ad937x_ctrl.hpp" +#include "mpm/lmk04828//lmk04828_spi_iface.hpp" //#include "lib_periphs.hpp" //#include "dboards.hpp" #include <boost/noncopyable.hpp> |