diff options
author | Michael West <michael.west@ettus.com> | 2013-11-20 12:14:24 -0800 |
---|---|---|
committer | Michael West <michael.west@ettus.com> | 2013-11-20 12:14:24 -0800 |
commit | 6ff935e6955be81f30606d0444a265ea03dc6f5d (patch) | |
tree | 27745786f543858b99d22de1d87f87da9f905f15 /host/lib | |
parent | 1fe3db82d6d292a186fe26e728dfdf68db4db056 (diff) | |
parent | 265e94473130ffefc95d4eb67e8d46ce50982be4 (diff) | |
download | uhd-6ff935e6955be81f30606d0444a265ea03dc6f5d.tar.gz uhd-6ff935e6955be81f30606d0444a265ea03dc6f5d.tar.bz2 uhd-6ff935e6955be81f30606d0444a265ea03dc6f5d.zip |
Merge remote branch
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/b200/b200_iface.cpp | 13 | ||||
-rw-r--r-- | host/lib/usrp/common/fx2_ctrl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_dsp_core_3000.cpp | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_iface.cpp | 6 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_clk_regs.hpp | 11 |
5 files changed, 24 insertions, 12 deletions
diff --git a/host/lib/usrp/b200/b200_iface.cpp b/host/lib/usrp/b200/b200_iface.cpp index e0809998e..a2e23cf1b 100644 --- a/host/lib/usrp/b200/b200_iface.cpp +++ b/host/lib/usrp/b200/b200_iface.cpp @@ -17,6 +17,7 @@ #include "b200_iface.hpp" +#include <uhd/config.hpp> #include <uhd/utils/msg.hpp> #include <uhd/exception.hpp> #include <boost/functional/hash.hpp> @@ -163,7 +164,7 @@ bool parse_record(std::string *record, boost::uint16_t &len, \ std::istringstream(record->substr(3, 4)) >> std::hex >> addr; std::istringstream(record->substr(7, 2)) >> std::hex >> type; - if (len >2 * (record->length() - 9)) // sanity check to prevent buffer overrun + if (len > (2 * (record->length() - 9))) // sanity check to prevent buffer overrun return false; for (i = 0; i < len; i++) { @@ -222,13 +223,13 @@ public: } - void write_i2c(boost::uint16_t addr __attribute__ ((unused)), const byte_vector_t &bytes __attribute__ ((unused))) + void write_i2c(UHD_UNUSED(boost::uint16_t addr), UHD_UNUSED(const byte_vector_t &bytes)) { throw uhd::not_implemented_error("b200 write i2c"); } - byte_vector_t read_i2c(boost::uint16_t addr __attribute__ ((unused)), size_t num_bytes __attribute__ ((unused))) + byte_vector_t read_i2c(UHD_UNUSED(boost::uint16_t addr), UHD_UNUSED(size_t num_bytes)) { throw uhd::not_implemented_error("b200 read i2c"); } @@ -303,7 +304,7 @@ public: } - void load_firmware(const std::string filestring, bool force __attribute__ ((unused)) = false) + void load_firmware(const std::string filestring, UHD_UNUSED(bool force) = false) { const char *filename = filestring.c_str(); @@ -333,7 +334,7 @@ public: std::string record; file >> record; - if (!record.length() > 0) + if (!(record.length() > 0)) continue; /* Check for valid Intel HEX record. */ @@ -433,7 +434,7 @@ public: UHD_THROW_INVALID_CODE_PATH(); // Below is dead code as long as UHD_THROW_INVALID_CODE_PATH(); is declared above. - // It is preservered here in a comment in case it is needed later: + // It is preserved here in a comment in case it is needed later: // fx3_control_write(B200_VREQ_FPGA_RESET, 0x00, 0x00, data, 4); } diff --git a/host/lib/usrp/common/fx2_ctrl.cpp b/host/lib/usrp/common/fx2_ctrl.cpp index 1cacc45cf..d68bf6058 100644 --- a/host/lib/usrp/common/fx2_ctrl.cpp +++ b/host/lib/usrp/common/fx2_ctrl.cpp @@ -119,7 +119,7 @@ bool parse_record(std::string *record, unsigned int &len, std::istringstream(record->substr(3, 4)) >> std::hex >> addr; std::istringstream(record->substr(7, 2)) >> std::hex >> type; - if (len >2 * (record->length() - 9)) // sanity check to prevent buffer overrun + if (len > (2 * (record->length() - 9))) // sanity check to prevent buffer overrun return false; for (i = 0; i < len; i++) { @@ -184,7 +184,7 @@ public: std::string record; file >> record; - if (!record.length() > 0) + if (!(record.length() > 0)) continue; //check for valid record diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.cpp b/host/lib/usrp/cores/tx_dsp_core_3000.cpp index 6fde70c5f..93c8702bc 100644 --- a/host/lib/usrp/cores/tx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_3000.cpp @@ -51,7 +51,7 @@ public: //init to something so update method has reasonable defaults _scaling_adjustment = 1.0; _dsp_extra_scaling = 1.0; - _tick_rate = 1.0; + this->set_tick_rate(1.0); } void set_tick_rate(const double rate){ diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp index 7c64714b7..6eff9d3ad 100644 --- a/host/lib/usrp/usrp1/usrp1_iface.cpp +++ b/host/lib/usrp/usrp1/usrp1_iface.cpp @@ -141,8 +141,10 @@ public: if (readback) { unsigned char buff[4] = { - (unsigned char)((bits >> 0) & 0xff), (unsigned char)((bits >> 8) & 0xff), - (unsigned char)((bits >> 16) & 0xff), (unsigned char)((bits >> 24) & 0xff) + (unsigned char)(bits & 0xff), + (unsigned char)((bits >> 8) & 0xff), + (unsigned char)((bits >> 16) & 0xff), + (unsigned char)((bits >> 24) & 0xff) }; //conditions where there are two header bytes if (num_bytes >= 3 and buff[num_bytes-1] != 0 and buff[num_bytes-2] != 0 and buff[num_bytes-3] == 0){ diff --git a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp index 45c0859d8..d5e506d8d 100644 --- a/host/lib/usrp/usrp2/usrp2_clk_regs.hpp +++ b/host/lib/usrp/usrp2/usrp2_clk_regs.hpp @@ -22,7 +22,16 @@ class usrp2_clk_regs_t { public: - usrp2_clk_regs_t(void):test(0),fpga(0),adc(0),dac(0),serdes(0),exp(0),tx_db(0),rx_db(0) { ; } + usrp2_clk_regs_t(void): + test(0), + fpga(0), + adc(0), + dac(0), + serdes(0), + exp(0), + tx_db(0), + rx_db(0) {} + usrp2_clk_regs_t(usrp2_iface::rev_type rev) { fpga = adc = serdes = exp = tx_db = 0; test = 0; |