summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-24 16:20:33 -0700
committerJosh Blum <josh@joshknows.com>2011-06-24 16:20:33 -0700
commit25d6e39c6af61acde0616cf50178d40741c4eace (patch)
tree80178578ab91d1243de6869c40b2f749d3bb966a /host/lib
parentd4ca69984701bda2299186140c7b551f19f9b550 (diff)
downloaduhd-25d6e39c6af61acde0616cf50178d40741c4eace.tar.gz
uhd-25d6e39c6af61acde0616cf50178d40741c4eace.tar.bz2
uhd-25d6e39c6af61acde0616cf50178d40741c4eace.zip
usrp2: init the usrp2_ctrl_data_t to make valgrind happy
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp12
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index ec1a2e94c..6ba364b28 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -179,7 +179,7 @@ public:
template <class T, usrp2_reg_action_t action>
T get_reg(boost::uint32_t addr, T data = 0){
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_GET_THIS_REGISTER_FOR_ME_BRO);
out_data.data.reg_args.addr = htonl(addr);
out_data.data.reg_args.data = htonl(boost::uint32_t(data));
@@ -207,7 +207,7 @@ public:
;
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO);
out_data.data.spi_args.dev = htonl(which_slave);
out_data.data.spi_args.miso_edge = spi_edge_to_otw[config.miso_edge];
@@ -228,7 +228,7 @@ public:
**********************************************************************/
void write_i2c(boost::uint8_t addr, const byte_vector_t &buf){
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO);
out_data.data.i2c_args.addr = addr;
out_data.data.i2c_args.bytes = buf.size();
@@ -246,7 +246,7 @@ public:
byte_vector_t read_i2c(boost::uint8_t addr, size_t num_bytes){
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO);
out_data.data.i2c_args.addr = addr;
out_data.data.i2c_args.bytes = num_bytes;
@@ -276,7 +276,7 @@ public:
BOOST_FOREACH(std::string item, queue) {
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_HEY_WRITE_THIS_UART_FOR_ME_BRO);
out_data.data.uart_args.dev = dev;
out_data.data.uart_args.bytes = item.size();
@@ -298,7 +298,7 @@ public:
std::string result;
while(readlen == 20) { //while we keep receiving full packets
//setup the out data
- usrp2_ctrl_data_t out_data;
+ usrp2_ctrl_data_t out_data = usrp2_ctrl_data_t();
out_data.id = htonl(USRP2_CTRL_ID_SO_LIKE_CAN_YOU_READ_THIS_UART_BRO);
out_data.data.uart_args.dev = dev;
out_data.data.uart_args.bytes = 20;
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index b5e50507c..aa584ac8b 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -93,7 +93,7 @@ static device_addrs_t usrp2_find(const device_addr_t &hint_){
);
//send a hello control packet
- usrp2_ctrl_data_t ctrl_data_out;
+ usrp2_ctrl_data_t ctrl_data_out = usrp2_ctrl_data_t();
ctrl_data_out.proto_ver = uhd::htonx<boost::uint32_t>(USRP2_FW_COMPAT_NUM);
ctrl_data_out.id = uhd::htonx<boost::uint32_t>(USRP2_CTRL_ID_WAZZUP_BRO);
udp_transport->send(boost::asio::buffer(&ctrl_data_out, sizeof(ctrl_data_out)));