Skip to content

Commit

Permalink
zephyr: mark-up maybe unused for assert, don't assert on remote wakeu…
Browse files Browse the repository at this point in the history
…p result
  • Loading branch information
benedekkupper committed Sep 21, 2024
1 parent f17aae1 commit 95e8aae
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions c2usb/port/zephyr/udc_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,34 @@ void udc_mac::init(const usb::speeds& speeds)
{
return k_msgq_put(&udc_mac_msgq, event, K_NO_WAIT);
};
auto ret = udc_init(dev_, dispatch);
[[maybe_unused]] auto ret = udc_init(dev_, dispatch);
assert(ret == 0);
}

void udc_mac::deinit()
{
auto ret = udc_shutdown(dev_);
[[maybe_unused]] auto ret = udc_shutdown(dev_);
assert(ret == 0);
}

bool udc_mac::set_attached(bool attached)
{
if (attached)
{
auto ret = udc_enable(dev_);
[[maybe_unused]] auto ret = udc_enable(dev_);
assert(ret == 0);
}
else
{
auto ret = udc_disable(dev_);
[[maybe_unused]] auto ret = udc_disable(dev_);
assert(ret == 0);
}
return udc_is_enabled(dev_);
}

void udc_mac::signal_remote_wakeup()
{
auto ret = udc_host_wakeup(dev_);
assert(ret == 0);
[[maybe_unused]] auto ret = udc_host_wakeup(dev_);
}

usb::speed udc_mac::speed() const
Expand All @@ -138,7 +137,7 @@ usb::speed udc_mac::speed() const

void udc_mac::control_ep_open()
{
auto ret = udc_set_address(dev_, 0);
[[maybe_unused]] auto ret = udc_set_address(dev_, 0);
assert(ret == 0);
// control endpoints are opened in udc_init
}
Expand All @@ -164,7 +163,7 @@ void udc_mac::control_reply(usb::direction dir, const usb::df::transfer& t)
net_buf_unref(ctrl_buf_);
ctrl_buf_ = nullptr;
}
auto ret = ep_set_stall(addr);
[[maybe_unused]] auto ret = ep_set_stall(addr);
assert(ret == result::OK);
return;
}
Expand Down

0 comments on commit 95e8aae

Please sign in to comment.