aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-01-08 09:33:36 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-04 08:07:26 -0600
commit107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 (patch)
treefdeaad56030a02948377c45838dab97beb7a5c84 /host/lib/usrp/usrp1
parent7d5e48032baa62cbe7467833b9e057900602f4b9 (diff)
downloaduhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.gz
uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.bz2
uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.zip
host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/dboard_iface.cpp50
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp18
-rw-r--r--host/lib/usrp/usrp1/soft_time_ctrl.cpp16
-rw-r--r--host/lib/usrp/usrp1/usrp1_iface.cpp16
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp4
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp8
6 files changed, 56 insertions, 56 deletions
diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp
index 8ad7a5466..7d2a44f39 100644
--- a/host/lib/usrp/usrp1/dboard_iface.cpp
+++ b/host/lib/usrp/usrp1/dboard_iface.cpp
@@ -81,12 +81,12 @@ public:
// else _codec->bypass_adc_buffers(false); //don't think this is necessary
}
- ~usrp1_dboard_iface()
+ ~usrp1_dboard_iface() override
{
/* NOP */
}
- special_props_t get_special_props()
+ special_props_t get_special_props() override
{
special_props_t props;
props.soft_clock_divider = true;
@@ -94,44 +94,44 @@ public:
return props;
}
- void write_aux_dac(unit_t, aux_dac_t, double);
- double read_aux_adc(unit_t, aux_adc_t);
+ void write_aux_dac(unit_t, aux_dac_t, double) override;
+ double read_aux_adc(unit_t, aux_adc_t) override;
- void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
- uint32_t get_pin_ctrl(unit_t unit);
+ void set_pin_ctrl(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff) override;
+ uint32_t get_pin_ctrl(unit_t unit) override;
void set_atr_reg(
- unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff);
- uint32_t get_atr_reg(unit_t unit, atr_reg_t reg);
- void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
- uint32_t get_gpio_ddr(unit_t unit);
- void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff);
- uint32_t get_gpio_out(unit_t unit);
- uint32_t read_gpio(unit_t unit);
+ unit_t unit, atr_reg_t reg, uint32_t value, uint32_t mask = 0xffffffff) override;
+ uint32_t get_atr_reg(unit_t unit, atr_reg_t reg) override;
+ void set_gpio_ddr(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff) override;
+ uint32_t get_gpio_ddr(unit_t unit) override;
+ void set_gpio_out(unit_t unit, uint32_t value, uint32_t mask = 0xffffffff) override;
+ uint32_t get_gpio_out(unit_t unit) override;
+ uint32_t read_gpio(unit_t unit) override;
void _set_pin_ctrl(unit_t, uint16_t);
void _set_atr_reg(unit_t, atr_reg_t, uint16_t);
void _set_gpio_ddr(unit_t, uint16_t);
void _set_gpio_out(unit_t, uint16_t);
- void set_command_time(const uhd::time_spec_t& t);
- uhd::time_spec_t get_command_time(void);
+ void set_command_time(const uhd::time_spec_t& t) override;
+ uhd::time_spec_t get_command_time(void) override;
- void write_i2c(uint16_t, const byte_vector_t&);
- byte_vector_t read_i2c(uint16_t, size_t);
+ void write_i2c(uint16_t, const byte_vector_t&) override;
+ byte_vector_t read_i2c(uint16_t, size_t) override;
void write_spi(
- unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits);
+ unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits) override;
uint32_t read_write_spi(
- unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits);
+ unit_t unit, const spi_config_t& config, uint32_t data, size_t num_bits) override;
- void set_clock_rate(unit_t, double);
- std::vector<double> get_clock_rates(unit_t);
- double get_clock_rate(unit_t);
- void set_clock_enabled(unit_t, bool);
- double get_codec_rate(unit_t);
+ void set_clock_rate(unit_t, double) override;
+ std::vector<double> get_clock_rates(unit_t) override;
+ double get_clock_rate(unit_t) override;
+ void set_clock_enabled(unit_t, bool) override;
+ double get_codec_rate(unit_t) override;
void set_fe_connection(
- unit_t unit, const std::string&, const fe_connection_t& fe_conn);
+ unit_t unit, const std::string&, const fe_connection_t& fe_conn) override;
private:
usrp1_iface::sptr _iface;
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index 4788c3d9e..b93cfa094 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -86,7 +86,7 @@ public:
/* NOP */
}
- void release(void)
+ void release(void) override
{
this->_commit_cb(_curr_buff, _next_buff, size());
}
@@ -337,12 +337,12 @@ public:
_stc = stc;
}
- size_t get_num_channels(void) const
+ size_t get_num_channels(void) const override
{
return this->size();
}
- size_t get_max_num_samps(void) const
+ size_t get_max_num_samps(void) const override
{
return _max_num_samps;
}
@@ -351,7 +351,7 @@ public:
const size_t nsamps_per_buff,
uhd::rx_metadata_t& metadata,
const double timeout,
- const bool one_packet)
+ const bool one_packet) override
{
// interleave a "soft" inline message into the receive stream:
if (_stc->get_inline_queue().pop_with_haste(metadata))
@@ -363,7 +363,7 @@ public:
return _stc->recv_post(metadata, num_samps_recvd);
}
- void issue_stream_cmd(const stream_cmd_t& stream_cmd)
+ void issue_stream_cmd(const stream_cmd_t& stream_cmd) override
{
_stc->issue_stream_cmd(stream_cmd);
}
@@ -389,12 +389,12 @@ public:
_tx_enb_fcn = tx_enb_fcn;
}
- size_t get_num_channels(void) const
+ size_t get_num_channels(void) const override
{
return this->size();
}
- size_t get_max_num_samps(void) const
+ size_t get_max_num_samps(void) const override
{
return _max_num_samps;
}
@@ -402,7 +402,7 @@ public:
size_t send(const tx_streamer::buffs_type& buffs,
const size_t nsamps_per_buff,
const uhd::tx_metadata_t& metadata,
- const double timeout_)
+ const double timeout_) override
{
double timeout = timeout_; // rw copy
_stc->send_pre(metadata, timeout);
@@ -426,7 +426,7 @@ public:
return num_samps_sent;
}
- bool recv_async_msg(async_metadata_t& async_metadata, double timeout = 0.1)
+ bool recv_async_msg(async_metadata_t& async_metadata, double timeout = 0.1) override
{
return _stc->get_async_queue().pop_with_timed_wait(async_metadata, timeout);
}
diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
index 42a1e9712..1c3015480 100644
--- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp
+++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
@@ -50,13 +50,13 @@ public:
/*******************************************************************
* Time control
******************************************************************/
- void set_time(const time_spec_t& time)
+ void set_time(const time_spec_t& time) override
{
boost::mutex::scoped_lock lock(_update_mutex);
_time_offset = uhd::get_system_time() - time;
}
- time_spec_t get_time(void)
+ time_spec_t get_time(void) override
{
boost::mutex::scoped_lock lock(_update_mutex);
return time_now();
@@ -80,7 +80,7 @@ public:
/*******************************************************************
* Receive control
******************************************************************/
- size_t recv_post(rx_metadata_t& md, const size_t nsamps)
+ size_t recv_post(rx_metadata_t& md, const size_t nsamps) override
{
boost::mutex::scoped_lock lock(_update_mutex);
@@ -125,7 +125,7 @@ public:
return nsamps;
}
- void issue_stream_cmd(const stream_cmd_t& cmd)
+ void issue_stream_cmd(const stream_cmd_t& cmd) override
{
_cmd_queue.push_with_wait(std::make_shared<stream_cmd_t>(cmd));
}
@@ -139,7 +139,7 @@ public:
/*******************************************************************
* Transmit control
******************************************************************/
- void send_pre(const tx_metadata_t& md, double& timeout)
+ void send_pre(const tx_metadata_t& md, double& timeout) override
{
if (not md.has_time_spec)
return;
@@ -211,17 +211,17 @@ public:
}
}
- bounded_buffer<async_metadata_t>& get_async_queue(void)
+ bounded_buffer<async_metadata_t>& get_async_queue(void) override
{
return _async_msg_queue;
}
- bounded_buffer<rx_metadata_t>& get_inline_queue(void)
+ bounded_buffer<rx_metadata_t>& get_inline_queue(void) override
{
return _inline_msg_queue;
}
- void stop(void)
+ void stop(void) override
{
_recv_cmd_task.reset();
}
diff --git a/host/lib/usrp/usrp1/usrp1_iface.cpp b/host/lib/usrp/usrp1/usrp1_iface.cpp
index 574dec51c..bcd416769 100644
--- a/host/lib/usrp/usrp1/usrp1_iface.cpp
+++ b/host/lib/usrp/usrp1/usrp1_iface.cpp
@@ -28,7 +28,7 @@ public:
_ctrl_transport = ctrl_transport;
}
- ~usrp1_iface_impl(void)
+ ~usrp1_iface_impl(void) override
{
/* NOP */
}
@@ -36,7 +36,7 @@ public:
/*******************************************************************
* Peek and Poke
******************************************************************/
- void poke32(const uint32_t addr, const uint32_t value)
+ void poke32(const uint32_t addr, const uint32_t value) override
{
uint32_t swapped = uhd::htonx(value);
@@ -56,7 +56,7 @@ public:
throw uhd::io_error("USRP1: failed control write");
}
- uint32_t peek32(const uint32_t addr)
+ uint32_t peek32(const uint32_t addr) override
{
UHD_LOGGER_TRACE("USRP1") << "peek32(" << std::dec << std::setw(2) << addr << ")";
@@ -77,12 +77,12 @@ public:
return uhd::ntohx(value_out);
}
- void poke16(const uint32_t, const uint16_t)
+ void poke16(const uint32_t, const uint16_t) override
{
throw uhd::not_implemented_error("Unhandled command poke16()");
}
- uint16_t peek16(const uint32_t)
+ uint16_t peek16(const uint32_t) override
{
throw uhd::not_implemented_error("Unhandled command peek16()");
return 0;
@@ -91,12 +91,12 @@ public:
/*******************************************************************
* I2C
******************************************************************/
- void write_i2c(uint16_t addr, const byte_vector_t& bytes)
+ void write_i2c(uint16_t addr, const byte_vector_t& bytes) override
{
return _ctrl_transport->write_i2c(addr, bytes);
}
- byte_vector_t read_i2c(uint16_t addr, size_t num_bytes)
+ byte_vector_t read_i2c(uint16_t addr, size_t num_bytes) override
{
return _ctrl_transport->read_i2c(addr, num_bytes);
}
@@ -116,7 +116,7 @@ public:
const spi_config_t&,
uint32_t bits,
size_t num_bits,
- bool readback)
+ bool readback) override
{
UHD_LOGGER_TRACE("USRP1")
<< "transact_spi: "
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index d86bf6d56..6ed1a6a69 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -439,9 +439,9 @@ usrp1_impl::usrp1_impl(const device_addr_t& device_addr)
_tree->access<double>(mb_path / "rx_dsps" / name / "freq" / "value").set(0.0);
}
- if (_tree->list(mb_path / "rx_dsps").size() > 0)
+ if (!_tree->list(mb_path / "rx_dsps").empty())
_tree->access<subdev_spec_t>(mb_path / "rx_subdev_spec").set(_rx_subdev_spec);
- if (_tree->list(mb_path / "tx_dsps").size() > 0)
+ if (!_tree->list(mb_path / "tx_dsps").empty())
_tree->access<subdev_spec_t>(mb_path / "tx_subdev_spec").set(_tx_subdev_spec);
_tree->create<double>(mb_path / "link_max_rate").set(USRP1_MAX_RATE_USB2);
}
diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp
index 336b82baa..a7f205c4a 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.hpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.hpp
@@ -63,12 +63,12 @@ public:
// structors
usrp1_impl(const uhd::device_addr_t&);
- ~usrp1_impl(void);
+ ~usrp1_impl(void) override;
// the io interface
- uhd::rx_streamer::sptr get_rx_stream(const uhd::stream_args_t& args);
- uhd::tx_streamer::sptr get_tx_stream(const uhd::stream_args_t& args);
- bool recv_async_msg(uhd::async_metadata_t&, double);
+ uhd::rx_streamer::sptr get_rx_stream(const uhd::stream_args_t& args) override;
+ uhd::tx_streamer::sptr get_tx_stream(const uhd::stream_args_t& args) override;
+ bool recv_async_msg(uhd::async_metadata_t&, double) override;
static uhd::usrp::mboard_eeprom_t get_mb_eeprom(uhd::i2c_iface::sptr);