aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types
diff options
context:
space:
mode:
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
}