diff options
author | michael-west <michael.west@ettus.com> | 2015-04-15 17:38:44 -0700 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2015-04-15 17:38:44 -0700 |
commit | df6bf0e77d42f2281fbe07296766924c3c066962 (patch) | |
tree | 98565fd79ba002531abe8b389ae7bc914cce5dfb /host/lib/usrp/b200/b200_impl.cpp | |
parent | be54951d4c14b11e21518f2e7d87fd527102c948 (diff) | |
download | uhd-df6bf0e77d42f2281fbe07296766924c3c066962.tar.gz uhd-df6bf0e77d42f2281fbe07296766924c3c066962.tar.bz2 uhd-df6bf0e77d42f2281fbe07296766924c3c066962.zip |
B200: Stricter checking of product and revision for frontend mapping.
Diffstat (limited to 'host/lib/usrp/b200/b200_impl.cpp')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index cea7e5969..f55ae2a71 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -238,6 +238,7 @@ b200_impl::b200_impl(const device_addr_t &device_addr) : //////////////////////////////////////////////////////////////////// std::string default_file_name; std::string product_name = "B200?"; + enum {UNKNOWN,B200,B210} product = UNKNOWN; if (not mb_eeprom["product"].empty()) { switch (boost::lexical_cast<boost::uint16_t>(mb_eeprom["product"])) @@ -246,11 +247,13 @@ b200_impl::b200_impl(const device_addr_t &device_addr) : case 0x7737: product_name = "B200"; default_file_name = B200_FPGA_FILE_NAME; + product = B200; break; case 0x7738: case 0x0002: product_name = "B210"; default_file_name = B210_FPGA_FILE_NAME; + product = B210; break; default: UHD_MSG(error) << "B200 unknown product code: " << mb_eeprom["product"] << std::endl; } @@ -263,14 +266,12 @@ b200_impl::b200_impl(const device_addr_t &device_addr) : //set up frontend mapping _fe1 = 1; _fe2 = 0; - if (not mb_eeprom["revision"].empty()) + if (product == B200 and + not mb_eeprom["revision"].empty() and + boost::lexical_cast<size_t>(mb_eeprom["revision"]) >= 5) { - size_t rev = boost::lexical_cast<size_t>(mb_eeprom["revision"]); - if (rev == 5) - { - _fe1 = 0; - _fe2 = 1; - } + _fe1 = 0; + _fe2 = 1; } //extract the FPGA path for the B200 |