From dd3b1fbd7632bbbe7f5df16d8080534d45e105e7 Mon Sep 17 00:00:00 2001 From: vkakade Date: Mon, 12 Jan 2015 19:22:53 -0600 Subject: Corrected the function to construct EEPROM vector. --- host/utils/b2xx_fx3_utils.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'host') 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(pid & 0xff)); - init_values.push_back(static_cast(pid >> 8)); - init_values.push_back(static_cast(vid & 0xff)); - init_values.push_back(static_cast(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(pid & 0xff); + init_values.at(5) = static_cast(pid >> 8); + init_values.at(6) = static_cast(vid & 0xff); + init_values.at(7) = static_cast(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; -- cgit v1.2.3