aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-04-26 13:13:32 -0700
committerMartin Braun <martin.braun@ettus.com>2018-05-02 17:01:21 -0700
commit5d9a7c92d3eb0a9cb719e6e6386d533da59a51db (patch)
tree024bda2ede2231784b55c48e1a23ab39fd97182d /host/lib/types
parentc52c0b69fc151c7596f9754e6b1e40dede531134 (diff)
downloaduhd-5d9a7c92d3eb0a9cb719e6e6386d533da59a51db.tar.gz
uhd-5d9a7c92d3eb0a9cb719e6e6386d533da59a51db.tar.bz2
uhd-5d9a7c92d3eb0a9cb719e6e6386d533da59a51db.zip
lib: Purge use of boost::assign, except for uhd::dict
Replaced with initialization lists. Note: uhd::dict does not work with initializer lists without making changes to said data structure. This commit has no functional changes, so keeping the boost::assigns for uhd::dict.
Diffstat (limited to 'host/lib/types')
-rw-r--r--host/lib/types/serial.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp
index 24da51e7f..afa99d051 100644
--- a/host/lib/types/serial.cpp
+++ b/host/lib/types/serial.cpp
@@ -6,7 +6,7 @@
//
#include <uhd/types/serial.hpp>
-#include <boost/assign/list_of.hpp>
+#include <uhdlib/utils/narrow.hpp>
#include <chrono>
#include <thread>
@@ -42,7 +42,10 @@ void i2c_iface::write_eeprom(
){
for (size_t i = 0; i < bytes.size(); i++){
//write a byte at a time, its easy that way
- byte_vector_t cmd = boost::assign::list_of(offset+i)(bytes[i]);
+ byte_vector_t cmd = {
+ narrow_cast<uint8_t>(offset+i),
+ narrow_cast<uint8_t>(bytes[i])
+ };
this->write_i2c(addr, cmd);
std::this_thread::sleep_for(std::chrono::milliseconds(10)); //worst case write
}
@@ -89,7 +92,10 @@ struct eeprom16_impl : i2c_iface
uint16_t offset,
size_t num_bytes
){
- byte_vector_t cmd = boost::assign::list_of(offset >> 8)(offset & 0xff);
+ byte_vector_t cmd = {
+ narrow_cast<uint8_t>(offset >> 8),
+ narrow_cast<uint8_t>(offset & 0xff)
+ };
this->write_i2c(addr, cmd);
return this->read_i2c(addr, num_bytes);
}
@@ -103,7 +109,11 @@ struct eeprom16_impl : i2c_iface
{
//write a byte at a time, its easy that way
uint16_t offset_i = offset+i;
- byte_vector_t cmd = boost::assign::list_of(offset_i >> 8)(offset_i & 0xff)(bytes[i]);
+ byte_vector_t cmd{
+ narrow_cast<uint8_t>(offset_i >> 8),
+ narrow_cast<uint8_t>(offset_i & 0xff),
+ bytes[i]
+ };
this->write_i2c(addr, cmd);
std::this_thread::sleep_for(std::chrono::milliseconds(10)); //worst case write
}