From f57ef3e745c85645faa3e9fd340b16bddfebb0ae Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Feb 2011 15:23:01 -0800 Subject: uhd: make ic reg maps depend on common.py --- host/lib/CMakeLists.txt | 2 +- host/lib/ic_reg_maps/CMakeLists.txt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'host/lib') diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index c8a5dd51e..8096c15d8 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -33,7 +33,7 @@ MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile) #make the outfile depend on the python script ADD_CUSTOM_COMMAND( - OUTPUT ${outfile} DEPENDS ${pyfile} + OUTPUT ${outfile} DEPENDS ${pyfile} ${LIBUHD_PYTHON_GEN_SOURCE_DEPS} COMMAND ${PYTHON_EXECUTABLE} -B ${pyfile} ${outfile} COMMENT "Generating ${outfile}" ) diff --git a/host/lib/ic_reg_maps/CMakeLists.txt b/host/lib/ic_reg_maps/CMakeLists.txt index 67a63c32b..9e1f4705e 100644 --- a/host/lib/ic_reg_maps/CMakeLists.txt +++ b/host/lib/ic_reg_maps/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010 Ettus Research LLC +# Copyright 2010-2011 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 @@ -20,6 +20,7 @@ ######################################################################## INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +SET(LIBUHD_PYTHON_GEN_SOURCE_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/common.py) LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_adf4350_regs.py @@ -90,3 +91,5 @@ LIBUHD_PYTHON_GEN_SOURCE( ${CMAKE_CURRENT_SOURCE_DIR}/gen_tuner_4937di5_regs.py ${CMAKE_CURRENT_BINARY_DIR}/tuner_4937di5_regs.hpp ) + +UNSET(LIBUHD_PYTHON_GEN_SOURCE_DEPS) -- cgit v1.2.3 From 77641c6f9b634c2153a0613b22ef6717bd2f21c3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Feb 2011 16:08:31 -0800 Subject: usrp-e100: disable the global reset for now --- host/lib/usrp/usrp_e100/usrp_e100_iface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp b/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp index ad36dd97a..c13e880f3 100644 --- a/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp +++ b/host/lib/usrp/usrp_e100/usrp_e100_iface.cpp @@ -110,7 +110,7 @@ public: } //very first thing, reset all the wishbone, always do first! - this->poke32(UE_REG_CLEAR_GLOBAL, 0); + //disabled for now: this->poke32(UE_REG_CLEAR_GLOBAL, 0); mb_eeprom = mboard_eeprom_t(get_i2c_dev_iface(), mboard_eeprom_t::MAP_E100); } -- cgit v1.2.3 From f1996ccf3fd211eb102468e2095caeaf6d603d8c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 28 Feb 2011 17:10:27 -0800 Subject: usrp2: minor optimization, only disable interruption when we need to wait() --- host/lib/usrp/usrp2/io_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index b20b6652e..7258585d1 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -81,10 +81,10 @@ public: * \return false on timeout */ UHD_INLINE bool check_fc_condition(seq_type seq, double timeout){ - boost::this_thread::disable_interruption di; //disable because the wait can throw boost::unique_lock lock(_fc_mutex); _last_seq_out = seq; if (this->ready()) return true; + boost::this_thread::disable_interruption di; //disable because the wait can throw return _fc_cond.timed_wait(lock, to_time_dur(timeout), _ready_fcn); } -- cgit v1.2.3 From c69d9c0205d897923b07ac77cb87633fb4925b53 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 1 Mar 2011 11:12:30 -0800 Subject: udp: return the managed recv buffer to the buffer queue on timeout --- host/lib/transport/udp_zero_copy.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'host/lib') diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp index dda3bb547..5810f441c 100644 --- a/host/lib/transport/udp_zero_copy.cpp +++ b/host/lib/transport/udp_zero_copy.cpp @@ -196,6 +196,8 @@ public: if (wait_for_recv_ready(_sock_fd, timeout)) return mrb->get_new( ::recv(_sock_fd, mrb->cast(), _recv_frame_size, 0) ); + + this->handle_recv(mrb); //timeout: return the managed buffer to the queue } return managed_recv_buffer::sptr(); } -- cgit v1.2.3 From 785096ccbb8a7548fb0c053357bc6b6f1a8334fb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 2 Mar 2011 11:11:02 -0800 Subject: usrp2: only include fw_common when needed, remove virtual send/recv, not exposed --- host/lib/usrp/usrp2/dboard_impl.cpp | 1 + host/lib/usrp/usrp2/mboard_impl.cpp | 1 + host/lib/usrp/usrp2/usrp2_iface.cpp | 1 + host/lib/usrp/usrp2/usrp2_iface.hpp | 8 -------- host/lib/usrp/usrp2/usrp2_impl.cpp | 1 + 5 files changed, 4 insertions(+), 8 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index b668d435b..4f1dcc46b 100644 --- a/host/lib/usrp/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -17,6 +17,7 @@ #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" +#include "fw_common.h" #include #include #include diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 397fae636..f20d3ab46 100644 --- a/host/lib/usrp/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp @@ -17,6 +17,7 @@ #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" +#include "fw_common.h" #include #include #include diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp index 4407a3011..bd1f5ccb5 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.cpp +++ b/host/lib/usrp/usrp2/usrp2_iface.cpp @@ -16,6 +16,7 @@ // #include "usrp2_regs.hpp" +#include "fw_common.h" #include "usrp2_iface.hpp" #include #include diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp index 49cb0e6dc..ea42d019f 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.hpp +++ b/host/lib/usrp/usrp2/usrp2_iface.hpp @@ -27,7 +27,6 @@ #include #include #include -#include "fw_common.h" #include "usrp2_regs.hpp" @@ -51,13 +50,6 @@ public: */ static sptr make(uhd::transport::udp_simple::sptr ctrl_transport); - /*! - * Perform a control transaction. - * \param data a control data struct - * \return the result control data - */ - virtual usrp2_ctrl_data_t ctrl_send_and_recv(const usrp2_ctrl_data_t &data) = 0; - /*! * Write a register (32 bits) * \param addr the address diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 9ce0f7359..8fd88e01d 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -16,6 +16,7 @@ // #include "usrp2_impl.hpp" +#include "fw_common.h" #include #include #include -- cgit v1.2.3 From 7aed95a658deb52404ba49774cfcecf96df654a8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 2 Mar 2011 18:21:54 -0800 Subject: usrp1: check for fw images only for uninitialized devices this prevents excessive warnings when usrp1 is not attached --- host/lib/usrp/usrp1/usrp1_impl.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index c395db0b9..918032037 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -60,20 +60,6 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) //since an address is intended for a different, non-USB, device. if (hint.has_key("addr")) return usrp1_addrs; - //extract the firmware path for the USRP1 - std::string usrp1_fw_image; - try{ - usrp1_fw_image = find_image_path(hint.get("fw", "usrp1_fw.ihx")); - } - catch(...){ - uhd::warning::post( - "Could not locate USRP1 firmware.\n" - "Please install the images package.\n" - ); - return usrp1_addrs; - } - //std::cout << "USRP1 firmware image: " << usrp1_fw_image << std::endl; - boost::uint16_t vid = hint.has_key("uninit") ? FX2_VENDOR_ID : USRP1_VENDOR_ID; boost::uint16_t pid = hint.has_key("uninit") ? FX2_PRODUCT_ID : USRP1_PRODUCT_ID; @@ -85,6 +71,20 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) //find the usrps and load firmware BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) { + //extract the firmware path for the USRP1 + std::string usrp1_fw_image; + try{ + usrp1_fw_image = find_image_path(hint.get("fw", "usrp1_fw.ihx")); + } + catch(...){ + uhd::warning::post( + "Could not locate USRP1 firmware.\n" + "Please install the images package.\n" + ); + return usrp1_addrs; + } + //std::cout << "USRP1 firmware image: " << usrp1_fw_image << std::endl; + usrp_ctrl::make(usb_control::make(handle))->usrp_load_firmware(usrp1_fw_image); } -- cgit v1.2.3