From 0d6454b27b99a137c55bc772a641e0df9d7ddaa0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 23 Sep 2014 11:01:53 -0700 Subject: cbx: Fixed LO FRAC truncation --- host/lib/usrp/dboard/db_cbx.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp index 78ecd9794..a64110fc7 100644 --- a/host/lib/usrp/dboard/db_cbx.cpp +++ b/host/lib/usrp/dboard/db_cbx.cpp @@ -19,6 +19,7 @@ #include "max2870_regs.hpp" #include "db_sbx_common.hpp" #include +#include using namespace uhd; using namespace uhd::usrp; @@ -94,10 +95,10 @@ double sbx_xcvr::cbx::set_lo_freq(dboard_iface::unit_t unit, double target_freq) vco_freq *= 2; RFdiv *= 2; } - + /* * The goal here is to loop though possible R dividers, - * band select clock dividers, N (int) dividers, and FRAC + * band select clock dividers, N (int) dividers, and FRAC * (frac) dividers. * * Calculate the N and F dividers for each set of values. @@ -122,7 +123,7 @@ double sbx_xcvr::cbx::set_lo_freq(dboard_iface::unit_t unit, double target_freq) N = int(vco_freq/pfd_freq); //Fractional-N calculation - FRAC = int((vco_freq/pfd_freq - N)*MOD); + FRAC = int(boost::math::round((vco_freq/pfd_freq - N)*MOD)); if(is_int_n) { if (FRAC > (MOD / 2)) { //Round integer such that actual freq is closest to target @@ -197,7 +198,8 @@ double sbx_xcvr::cbx::set_lo_freq(dboard_iface::unit_t unit, double target_freq) regs.r_counter_10_bit = R; regs.reference_divide_by_2 = T; regs.reference_doubler = D; - regs.band_select_clock_div = BS; + regs.band_select_clock_div = (BS & 0x0FF); + regs.bs_msb = (BS & 0x300) >>8; UHD_ASSERT_THROW(rfdivsel_to_enum.has_key(RFdiv)); regs.rf_divider_select = rfdivsel_to_enum[RFdiv]; regs.int_n_mode = (is_int_n) ? max2870_regs_t::INT_N_MODE_INT_N : max2870_regs_t::INT_N_MODE_FRAC_N; -- cgit v1.2.3 From df0c602c43959d15b5102fefe0b2d999a6b27141 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Fri, 29 Aug 2014 10:06:47 -0700 Subject: usrp: don't print duplicate GPSDO detection messages --- host/lib/usrp/b200/b200_impl.cpp | 1 - host/lib/usrp/e100/e100_impl.cpp | 4 +--- host/lib/usrp/usrp2/usrp2_impl.cpp | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index bf5fdd251..7f92ae33a 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -304,7 +304,6 @@ b200_impl::b200_impl(const device_addr_t &device_addr) } else { - UHD_MSG(status) << "not found" << std::endl; _local_ctrl->poke32(TOREG(SR_CORE_GPSDO_ST), B200_GPSDO_ST_NONE); } } diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp index b49ba64a2..1d026e2bf 100644 --- a/host/lib/usrp/e100/e100_impl.cpp +++ b/host/lib/usrp/e100/e100_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010-2012 Ettus Research LLC +// Copyright 2010-2012,2014 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 @@ -259,7 +259,6 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ } if (_gps and _gps->gps_detected()) { - UHD_MSG(status) << "found" << std::endl; BOOST_FOREACH(const std::string &name, _gps->get_sensors()) { _tree->create(mb_path / "sensors" / name) @@ -268,7 +267,6 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){ } else { - UHD_MSG(status) << "not found" << std::endl; std::ofstream(GPSDO_VOLATILE_PATH.string().c_str(), std::ofstream::binary) << "42" << std::endl; } } diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index d96a8ab7d..3414b7009 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -523,7 +523,6 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ } if (_mbc[mb].gps and _mbc[mb].gps->gps_detected()) { - UHD_MSG(status) << "found" << std::endl; BOOST_FOREACH(const std::string &name, _mbc[mb].gps->get_sensors()) { _tree->create(mb_path / "sensors" / name) @@ -532,7 +531,6 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ } else { - UHD_MSG(status) << "not found" << std::endl; _mbc[mb].iface->pokefw(U2_FW_REG_HAS_GPSDO, dont_look_for_gpsdo); } } -- cgit v1.2.3 From 8f4501b009a26bc2fc5dfdebf76052b1acd57d34 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Tue, 2 Sep 2014 11:37:55 +0200 Subject: uhd_dump: use LIBS instead of LDFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows distro override for LDFLAGS and doesn't break the build process. Signed-off-by: Jaroslav Škarvada --- tools/uhd_dump/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/uhd_dump/Makefile b/tools/uhd_dump/Makefile index b793776d4..0494767bb 100644 --- a/tools/uhd_dump/Makefile +++ b/tools/uhd_dump/Makefile @@ -20,7 +20,7 @@ OBJECTS = uhd_dump.o CFLAGS = -g -O0 -Wall -LDFLAGS = -lpcap -lm +LIBS = -lpcap -lm CC = cc @@ -28,7 +28,7 @@ CC = cc all: $(BINARIES) chdr_log: uhd_dump.o chdr_log.o $(INCLUDES) - $(CC) $(CFLAGS) -o $@ uhd_dump.o chdr_log.o $(LDFLAGS) + $(CC) $(CFLAGS) -o $@ uhd_dump.o chdr_log.o $(LIBS) $(LDFLAGS) -- cgit v1.2.3 From 4547d1c74a6c875057f23f8ea77033b9cd191539 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Tue, 2 Sep 2014 11:58:24 +0200 Subject: chdr-dissector: fix wireshark-1.12 detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- tools/chdr-dissector/cmake/Modules/FindWireshark.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/chdr-dissector/cmake/Modules/FindWireshark.cmake b/tools/chdr-dissector/cmake/Modules/FindWireshark.cmake index 59497da16..276201245 100644 --- a/tools/chdr-dissector/cmake/Modules/FindWireshark.cmake +++ b/tools/chdr-dissector/cmake/Modules/FindWireshark.cmake @@ -16,7 +16,7 @@ # wireshark does not install its library with pkg-config information, # so we need to manually find the libraries and headers -FIND_PATH( WIRESHARK_INCLUDE_DIRS epan/column_info.h PATH_SUFFIXES wireshark ) +FIND_PATH( WIRESHARK_INCLUDE_DIRS epan/column.h PATH_SUFFIXES wireshark ) FIND_LIBRARY( WIRESHARK_LIBRARIES wireshark ) # Report results -- cgit v1.2.3 From c431a66df3df4cff82bfa2d2b2c7b16895a7efd6 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 19 Aug 2014 16:40:09 +0200 Subject: uhd: Added an operator/ for (fs_path, size_t) This is useful when constructing property tree paths. With this path, the following code would be valid: size_t mb_index = 0; fs_path mb_root = "/mboards"; mb_root = mb_root / mb_index; This is a shortcut for the (in UHD very common) mb_root = mb_root / boost::lexical_cast(rhs); + return lhs / rhs_str; +} + /*********************************************************************** * Property tree implementation **********************************************************************/ diff --git a/host/tests/property_test.cpp b/host/tests/property_test.cpp index 04d3a831c..00bb3c022 100644 --- a/host/tests/property_test.cpp +++ b/host/tests/property_test.cpp @@ -173,3 +173,24 @@ BOOST_AUTO_TEST_CASE(test_prop_subtree){ BOOST_CHECK_EQUAL_COLLECTIONS(tree_dirs2.begin(), tree_dirs2.end(), subtree2_dirs.begin(), subtree2_dirs.end()); } + + +BOOST_AUTO_TEST_CASE(test_prop_operators) +{ + uhd::fs_path path1 = "/root/"; + path1 = path1 / "leaf"; + BOOST_CHECK_EQUAL(path1, "/root/leaf"); + + uhd::fs_path path2 = "/root"; + path2 = path2 / "leaf"; + BOOST_CHECK_EQUAL(path2, "/root/leaf"); + + uhd::fs_path path3 = "/root/"; + path3 = path3 / "/leaf/"; + BOOST_CHECK_EQUAL(path3, "/root/leaf/"); + + uhd::fs_path path4 = "/root/"; + size_t x = 2; + path4 = path4 / x; + BOOST_CHECK_EQUAL(path4, "/root/2"); +} -- cgit v1.2.3