diff options
author | vkakade <virendra.kakade@ni.com> | 2015-01-12 19:22:53 -0600 |
---|---|---|
committer | vkakade <virendra.kakade@ni.com> | 2015-01-12 19:22:53 -0600 |
commit | dd3b1fbd7632bbbe7f5df16d8080534d45e105e7 (patch) | |
tree | ec0d56124f629ad2ebf50632325fec7c364bd281 /host | |
parent | 3aa3560fbb898cb4291371b642e25525872e3117 (diff) | |
download | uhd-dd3b1fbd7632bbbe7f5df16d8080534d45e105e7.tar.gz uhd-dd3b1fbd7632bbbe7f5df16d8080534d45e105e7.tar.bz2 uhd-dd3b1fbd7632bbbe7f5df16d8080534d45e105e7.zip |
Corrected the function to construct EEPROM vector.
Diffstat (limited to 'host')
-rw-r--r-- | host/utils/b2xx_fx3_utils.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index 422f454d1..081141048 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -61,14 +61,14 @@ static const size_t EEPROM_INIT_VALUE_VECTOR_SIZE = 8; static uhd::byte_vector_t construct_eeprom_init_value_vector(boost::uint16_t vid, boost::uint16_t pid) { uhd::byte_vector_t init_values(EEPROM_INIT_VALUE_VECTOR_SIZE); - init_values.push_back(0x43); - init_values.push_back(0x59); - init_values.push_back(0x14); - init_values.push_back(0xB2); - init_values.push_back(static_cast<boost::uint8_t>(pid & 0xff)); - init_values.push_back(static_cast<boost::uint8_t>(pid >> 8)); - init_values.push_back(static_cast<boost::uint8_t>(vid & 0xff)); - init_values.push_back(static_cast<boost::uint8_t>(vid >> 8)); + init_values.at(0) = 0x43; + init_values.at(1) = 0x59; + init_values.at(2) = 0x14; + init_values.at(3) = 0xB2; + init_values.at(4) = static_cast<boost::uint8_t>(pid & 0xff); + init_values.at(5) = static_cast<boost::uint8_t>(pid >> 8); + init_values.at(6) = static_cast<boost::uint8_t>(vid & 0xff); + init_values.at(7) = static_cast<boost::uint8_t>(vid >> 8); return init_values; } @@ -234,7 +234,7 @@ int read_eeprom(b200_iface::sptr& b200, uhd::byte_vector_t& data) int write_eeprom(b200_iface::sptr& b200, const uhd::byte_vector_t& data) { try { - b200->write_eeprom(0x0, 0x0, data); + b200->write_eeprom(0x0, 0x0, data); } catch (std::exception &e) { std::cerr << "Exception while writing EEPROM: " << e.what() << std::endl; return -1; |