diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2015-03-30 16:56:01 -0700 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2015-03-30 16:56:01 -0700 |
commit | 700bf99bdc483fdcc9deb54abc29bd7f81e16089 (patch) | |
tree | 42d4f30e7a4abc9e47dcd01300a2f44ab1b91510 /host/lib/usrp/b200 | |
parent | 6a34824ad10eaa2d2b642b959f278f6c4e326d6d (diff) | |
parent | 61599b3eaadcc46ac8d24974176d7fd89778d06e (diff) | |
download | uhd-700bf99bdc483fdcc9deb54abc29bd7f81e16089.tar.gz uhd-700bf99bdc483fdcc9deb54abc29bd7f81e16089.tar.bz2 uhd-700bf99bdc483fdcc9deb54abc29bd7f81e16089.zip |
Merge branch 'master' into ashish/vivado
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r-- | host/lib/usrp/b200/b200_iface.cpp | 10 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 15 |
2 files changed, 18 insertions, 7 deletions
diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp index 820090959..270d3bb4b 100644 --- a/host/lib/usrp/b200/b200_iface.cpp +++ b/host/lib/usrp/b200/b200_iface.cpp @@ -89,7 +89,7 @@ typedef boost::uint32_t hash_type; * Create a file hash * The hash will be used to identify the loaded firmware and fpga image * \param filename file used to generate hash value - * \return hash value in a size_t type + * \return hash value in a uint32_t type */ static hash_type generate_hash(const char *filename) { @@ -101,13 +101,15 @@ static hash_type generate_hash(const char *filename) throw uhd::io_error(std::string("cannot open input file ") + filename); } - size_t hash = 0; + hash_type hash = 0; char ch; long long count = 0; while (file.get(ch)) { count++; - boost::hash_combine(hash, ch); + //hash algorithm derived from boost hash_combine + //http://www.boost.org/doc/libs/1_35_0/doc/html/boost/hash_combine_id241013.html + hash ^= ch + 0x9e3779b9 + (hash<<6) + (hash>>2); } if (count == 0){ @@ -547,7 +549,7 @@ public: size_t file_size = 0; { std::ifstream file(filename, std::ios::in | std::ios::binary | std::ios::ate); - file_size = file.tellg(); + file_size = size_t(file.tellg()); } std::ifstream file; diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 647c64695..e1b106208 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -738,6 +738,15 @@ void b200_impl::setup_radio(const size_t dspno) .subscribe(boost::bind(&ad9361_ctrl::set_iq_balance_auto, _codec_ctrl, key, _1)).set(true); } + //add all frontend filters + std::vector<std::string> filter_names = _codec_ctrl->get_filter_names(key); + for(size_t i = 0;i < filter_names.size(); i++) + { + _tree->create<filter_info_base::sptr>(rf_fe_path / "filters" / filter_names[i] / "value" ) + .publish(boost::bind(&ad9361_ctrl::get_filter, _codec_ctrl, key, filter_names[i])) + .subscribe(boost::bind(&ad9361_ctrl::set_filter, _codec_ctrl, key, filter_names[i], _1)); + } + //setup antenna stuff if (key[0] == 'R') { @@ -777,7 +786,7 @@ void b200_impl::register_loopback_self_test(wb_iface::sptr iface) { bool test_fail = false; UHD_MSG(status) << "Performing register loopback test... " << std::flush; - size_t hash = time(NULL); + size_t hash = size_t(time(NULL)); for (size_t i = 0; i < 100; i++) { boost::hash_combine(hash, i); @@ -1025,7 +1034,7 @@ void b200_impl::update_gpio_state(void) | (_gpio_state.ref_sel << 0) ; - _local_ctrl->poke32(TOREG(RB32_CORE_MISC), misc_word); + _local_ctrl->poke32(TOREG(SR_CORE_MISC), misc_word); } void b200_impl::reset_codec_dcm(void) @@ -1122,6 +1131,6 @@ sensor_value_t b200_impl::get_ref_locked(void) sensor_value_t b200_impl::get_fe_pll_locked(const bool is_tx) { const boost::uint32_t st = _local_ctrl->peek32(RB32_CORE_PLL); - const bool locked = is_tx ? bool(st & 0x1) : bool(st & 0x2); + const bool locked = is_tx ? ((st & 0x1) > 0) : ((st & 0x2) > 0); return sensor_value_t("LO", locked, "locked", "unlocked"); } |