Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekkupper committed Jun 29, 2024
1 parent 67dc05e commit 3bf2246
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion c2usb/i2c/hid/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class device : public slave::module, public ::hid::transport
POWER_STATE_CHANGE = 0,
};
using power_event_delegate = etl::delegate<void(device&, event)>;
void set_power_event_delegate(const power_event_delegate&& delegate)
void set_power_event_delegate(const power_event_delegate& delegate)
{
power_event_delegate_ = delegate;
}
Expand Down
2 changes: 1 addition & 1 deletion c2usb/port/zephyr/bluetooth/hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ ssize_t service::ccc_cfg_write(::bt_conn* conn, const gatt::attribute* attr, gat
}

// prevent changing protocol mode
if ((protocol == protocol::BOOT) && (this_->get_protocol() != protocol))
if ((protocol == protocol::BOOT) and (this_->get_protocol() != protocol))
{
return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED);
}
Expand Down
2 changes: 1 addition & 1 deletion c2usb/usb/df/class/cdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function::get_base_functional_descriptors(class_info cinfo, uint8_t if_index, df

void function::start(const config::interface& iface, uint8_t alt_sel)
{
if (iface.primary() && (iface.endpoints().size() > 0))
if (iface.primary() and (iface.endpoints().size() > 0))
{
notify_eph_ = open_ep(iface.endpoints()[0]);
}
Expand Down
7 changes: 1 addition & 6 deletions c2usb/usb/df/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class device : protected mac::device_interface
CONFIGURATION_CHANGE,
};
using power_event_delegate = etl::delegate<void(device&, event)>;
void set_power_event_delegate(const power_event_delegate&& delegate)
void set_power_event_delegate(const power_event_delegate& delegate)
{
power_event_delegate_ = delegate;
}
Expand Down Expand Up @@ -155,11 +155,6 @@ class device : protected mac::device_interface
void handle_control_message(message& msg) override;
void handle_new_power_state(usb::power::state new_state) override;

device(const device&) = delete;
device& operator=(const device&) = delete;
device(const device&&) = delete;
device& operator=(const device&&) = delete;

protected:
usb::df::mac& mac_;
const product_info& product_info_;
Expand Down
4 changes: 2 additions & 2 deletions c2usb/usb/product_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ struct product_info

constexpr product_info(uint16_t vendor_id, const char_t* vendor_name, uint16_t product_id,
const char_t* product_name, version product_version,
const std::span<const uint8_t>&& serial_no = {})
const std::span<const uint8_t>& serial_no = {})
: vendor_name(vendor_name),
product_name(product_name),
serial_number(std::move(serial_no)),
serial_number(serial_no),
vendor_id(vendor_id),
product_id(product_id),
product_version(product_version)
Expand Down

0 comments on commit 3bf2246

Please sign in to comment.