aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common/fx2_ctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/common/fx2_ctrl.cpp')
-rw-r--r--host/lib/usrp/common/fx2_ctrl.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/host/lib/usrp/common/fx2_ctrl.cpp b/host/lib/usrp/common/fx2_ctrl.cpp
index 3c6df7079..7b8920eb1 100644
--- a/host/lib/usrp/common/fx2_ctrl.cpp
+++ b/host/lib/usrp/common/fx2_ctrl.cpp
@@ -139,6 +139,15 @@ public:
_ctrl_transport = ctrl_transport;
}
+ void usrp_fx2_reset(void){
+ unsigned char reset_y = 1;
+ unsigned char reset_n = 0;
+ usrp_control_write(FX2_FIRMWARE_LOAD, 0xe600, 0, &reset_y, 1);
+ usrp_control_write(FX2_FIRMWARE_LOAD, 0xe600, 0, &reset_n, 1);
+ //wait for things to settle
+ boost::this_thread::sleep(boost::posix_time::milliseconds(2000));
+ }
+
void usrp_load_firmware(std::string filestring, bool force)
{
const char *filename = filestring.c_str();
@@ -419,7 +428,7 @@ public:
{
UHD_ASSERT_THROW(bytes.size() < max_i2c_data_bytes);
- unsigned char buff[max_i2c_data_bytes];
+ unsigned char buff[max_i2c_data_bytes] = {};
std::copy(bytes.begin(), bytes.end(), buff);
int ret = this->usrp_i2c_write(addr & 0xff,
@@ -434,7 +443,7 @@ public:
{
UHD_ASSERT_THROW(num_bytes < max_i2c_data_bytes);
- unsigned char buff[max_i2c_data_bytes];
+ unsigned char buff[max_i2c_data_bytes] = {};
int ret = this->usrp_i2c_read(addr & 0xff,
buff,
num_bytes);