diff options
author | Josh Blum <josh@joshknows.com> | 2011-05-17 15:12:38 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-05-17 15:12:38 -0700 |
commit | 0aff497dacc9cc4eba5d800cc46343da083cfdf1 (patch) | |
tree | 86ba88e9b103e82140a0413b1ed62ef8d38d0d7b | |
parent | 9065043544dd129e16d7bb30ae8cb8d5562c3326 (diff) | |
parent | 17ecc9a442c999f4e752a3c0dc6d237392a499e3 (diff) | |
download | uhd-0aff497dacc9cc4eba5d800cc46343da083cfdf1.tar.gz uhd-0aff497dacc9cc4eba5d800cc46343da083cfdf1.tar.bz2 uhd-0aff497dacc9cc4eba5d800cc46343da083cfdf1.zip |
Merge branch 'master' into release_workrelease_003_001_000
-rw-r--r-- | host/CMakeLists.txt | 5 | ||||
-rw-r--r-- | host/Modules/UHDPackage.cmake | 76 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/mboard_impl.cpp | 12 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.hpp | 1 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/codec_ctrl.cpp | 66 |
5 files changed, 79 insertions, 81 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 1559bd6bf..034257551 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -231,7 +231,10 @@ ADD_SUBDIRECTORY(usrp_e_utils) ######################################################################## IF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") FILE(GLOB _image_files "${UHD_IMAGES_DIR}/*.*") - MESSAGE(STATUS "Using images: ${_image_files}") + MESSAGE(STATUS "Using images:") + FOREACH(_img ${_image_files}) + MESSAGE(STATUS " ${_img}") + ENDFOREACH(_img) INSTALL(FILES ${_image_files} DESTINATION ${PKG_DATA_DIR}/images COMPONENT images) ENDIF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") diff --git a/host/Modules/UHDPackage.cmake b/host/Modules/UHDPackage.cmake index c230f1b1e..e36793d73 100644 --- a/host/Modules/UHDPackage.cmake +++ b/host/Modules/UHDPackage.cmake @@ -36,46 +36,46 @@ IF(LINUX AND EXISTS "/etc/redhat-release") ENDIF() ######################################################################## +# Set generator type for recognized systems +######################################################################## +IF(CPACK_GENERATOR) + #already set +ELSEIF(APPLE) + SET(CPACK_GENERATOR PackageMaker) +ELSEIF(WIN32) + SET(CPACK_GENERATOR NSIS) +ELSEIF(DEBIAN) + SET(CPACK_GENERATOR DEB) +ELSEIF(REDHAT) + SET(CPACK_GENERATOR RPM) +ELSE() + SET(CPACK_GENERATOR TGZ) +ENDIF() + +######################################################################## # Setup package file name ######################################################################## -IF(UHD_RELEASE_MODE) - - #set generator type for recognized systems - IF(APPLE) - SET(CPACK_GENERATOR PackageMaker) - ELSEIF(WIN32) - SET(CPACK_GENERATOR NSIS) - ELSEIF(DEBIAN) - SET(CPACK_GENERATOR DEB) - ELSEIF(REDHAT) - SET(CPACK_GENERATOR RPM) - ELSE() - SET(CPACK_GENERATOR TGZ) - ENDIF() - - FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release) - IF(LSB_RELEASE_EXECUTABLE) - - #extract system information by executing the commands - EXECUTE_PROCESS( - COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id - OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE - ) - EXECUTE_PROCESS( - COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release - OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - #set a more sensible package name for this system - SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}") - - ENDIF(LSB_RELEASE_EXECUTABLE) - - IF(${CPACK_GENERATOR} STREQUAL NSIS) - SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}") - ENDIF() - -ENDIF(UHD_RELEASE_MODE) +FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release) +IF((DEBIAN OR REDHAT) AND LSB_RELEASE_EXECUTABLE) + + #extract system information by executing the commands + EXECUTE_PROCESS( + COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id + OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE + ) + EXECUTE_PROCESS( + COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release + OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + #set a more sensible package name for this system + SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}") + +ENDIF() + +IF(${CPACK_GENERATOR} STREQUAL NSIS) + SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}") +ENDIF() ######################################################################## # Setup CPack General diff --git a/host/lib/usrp/usrp1/mboard_impl.cpp b/host/lib/usrp/usrp1/mboard_impl.cpp index e9108e4f1..f699c8e12 100644 --- a/host/lib/usrp/usrp1/mboard_impl.cpp +++ b/host/lib/usrp/usrp1/mboard_impl.cpp @@ -295,7 +295,7 @@ void usrp1_impl::mboard_get(const wax::obj &key_, wax::obj &val) return; case MBOARD_PROP_CLOCK_CONFIG: - val = _clock_config; + val = clock_config_t::internal(); return; case MBOARD_PROP_RX_SUBDEV_SPEC: @@ -389,6 +389,16 @@ void usrp1_impl::mboard_set(const wax::obj &key, const wax::obj &val) _clock_ctrl->set_master_clock_freq(val.as<double>()); return; + case MBOARD_PROP_CLOCK_CONFIG:{ + clock_config_t clock_config = val.as<clock_config_t>(); + if (clock_config.ref_source != clock_config_t::REF_INT){ + throw uhd::value_error("USRP1 clock config: reference source must be set to internal"); + } + if (clock_config.pps_source != clock_config_t::PPS_INT){ + throw uhd::value_error("USRP1 clock config: PPS source must be set to internal"); + } + }return; + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index 69ad9b0a0..a4d40a54d 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -136,7 +136,6 @@ private: uhd::otw_type_t _tx_otw_type; //configuration shadows - uhd::clock_config_t _clock_config; uhd::usrp::subdev_spec_t _rx_subdev_spec, _tx_subdev_spec; //clock control diff --git a/host/lib/usrp/usrp_e100/codec_ctrl.cpp b/host/lib/usrp/usrp_e100/codec_ctrl.cpp index c2f2712e3..43ad94a88 100644 --- a/host/lib/usrp/usrp_e100/codec_ctrl.cpp +++ b/host/lib/usrp/usrp_e100/codec_ctrl.cpp @@ -54,7 +54,6 @@ public: private: usrp_e100_iface::sptr _iface; ad9862_regs_t _ad9862_regs; - aux_adc_t _last_aux_adc_a, _last_aux_adc_b; void send_reg(boost::uint8_t addr); void recv_reg(boost::uint8_t addr); }; @@ -108,6 +107,10 @@ usrp_e100_codec_ctrl_impl::usrp_e100_codec_ctrl_impl(usrp_e100_iface::sptr iface this->send_reg(addr); } + //always start conversions for aux ADC + _ad9862_regs.start_a = 1; + _ad9862_regs.start_b = 1; + //aux adc clock _ad9862_regs.clk_4 = ad9862_regs_t::CLK_4_1_4; this->send_reg(34); @@ -179,51 +182,34 @@ static double aux_adc_to_volts(boost::uint8_t high, boost::uint8_t low){ } double usrp_e100_codec_ctrl_impl::read_aux_adc(aux_adc_t which){ - //check to see if the switch needs to be set - bool write_switch = false; switch(which){ - case AUX_ADC_A1: + _ad9862_regs.select_a = ad9862_regs_t::SELECT_A_AUX_ADC1; + this->send_reg(34); //start conversion and select mux + this->recv_reg(28); //read the value (2 bytes, 2 reads) + this->recv_reg(29); + return aux_adc_to_volts(_ad9862_regs.aux_adc_a1_9_2, _ad9862_regs.aux_adc_a1_1_0); + case AUX_ADC_A2: - if (which != _last_aux_adc_a){ - _ad9862_regs.select_a = (which == AUX_ADC_A1)? - ad9862_regs_t::SELECT_A_AUX_ADC1: ad9862_regs_t::SELECT_A_AUX_ADC2; - _last_aux_adc_a = which; - write_switch = true; - } - break; + _ad9862_regs.select_a = ad9862_regs_t::SELECT_A_AUX_ADC2; + this->send_reg(34); //start conversion and select mux + this->recv_reg(26); //read the value (2 bytes, 2 reads) + this->recv_reg(27); + return aux_adc_to_volts(_ad9862_regs.aux_adc_a2_9_2, _ad9862_regs.aux_adc_a2_1_0); case AUX_ADC_B1: - case AUX_ADC_B2: - if (which != _last_aux_adc_b){ - _ad9862_regs.select_b = (which == AUX_ADC_B1)? - ad9862_regs_t::SELECT_B_AUX_ADC1: ad9862_regs_t::SELECT_B_AUX_ADC2; - _last_aux_adc_b = which; - write_switch = true; - } - break; - - } + _ad9862_regs.select_b = ad9862_regs_t::SELECT_B_AUX_ADC1; + this->send_reg(34); //start conversion and select mux + this->recv_reg(32); //read the value (2 bytes, 2 reads) + this->recv_reg(33); + return aux_adc_to_volts(_ad9862_regs.aux_adc_b1_9_2, _ad9862_regs.aux_adc_b1_1_0); - //write the switch if it changed - if(write_switch) this->send_reg(34); - - //map aux adcs to register values to read - static const uhd::dict<aux_adc_t, boost::uint8_t> aux_dac_to_addr = boost::assign::map_list_of - (AUX_ADC_A2, 26) (AUX_ADC_A1, 28) - (AUX_ADC_B2, 30) (AUX_ADC_B1, 32) - ; - - //read the value - this->recv_reg(aux_dac_to_addr[which]+0); - this->recv_reg(aux_dac_to_addr[which]+1); - - //return the value scaled to volts - switch(which){ - case AUX_ADC_A1: return aux_adc_to_volts(_ad9862_regs.aux_adc_a1_9_2, _ad9862_regs.aux_adc_a1_1_0); - case AUX_ADC_A2: return aux_adc_to_volts(_ad9862_regs.aux_adc_a2_9_2, _ad9862_regs.aux_adc_a2_1_0); - case AUX_ADC_B1: return aux_adc_to_volts(_ad9862_regs.aux_adc_b1_9_2, _ad9862_regs.aux_adc_b1_1_0); - case AUX_ADC_B2: return aux_adc_to_volts(_ad9862_regs.aux_adc_b2_9_2, _ad9862_regs.aux_adc_b2_1_0); + case AUX_ADC_B2: + _ad9862_regs.select_b = ad9862_regs_t::SELECT_B_AUX_ADC2; + this->send_reg(34); //start conversion and select mux + this->recv_reg(30); //read the value (2 bytes, 2 reads) + this->recv_reg(31); + return aux_adc_to_volts(_ad9862_regs.aux_adc_b2_9_2, _ad9862_regs.aux_adc_b2_1_0); } UHD_THROW_INVALID_CODE_PATH(); } |