usb: ISO endpoint size may not be power of 2.

By this commit exception for ISO endpoints is made when it comes
to its size. ISO endpoint buffer size for nrf devices is 1023 and
may be configured with variable length size. NRFX checks is size
is chosen accordingly and it is no reason to do it in SHIM.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This commit is contained in:
Emil Obalski 2020-01-24 09:54:41 +01:00 committed by Carles Cufí
parent 7e95a45222
commit 79704fac5a

View file

@ -1470,10 +1470,13 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const ep_cfg)
ep_ctx->cfg.type = ep_cfg->ep_type;
ep_ctx->cfg.max_sz = ep_cfg->ep_mps;
if ((ep_cfg->ep_mps & (ep_cfg->ep_mps - 1)) != 0U) {
LOG_ERR("EP max packet size must be a power of 2");
return -EINVAL;
if (!NRF_USBD_EPISO_CHECK(ep_cfg->ep_addr)) {
if ((ep_cfg->ep_mps & (ep_cfg->ep_mps - 1)) != 0U) {
LOG_ERR("EP max packet size must be a power of 2");
return -EINVAL;
}
}
nrfx_usbd_ep_max_packet_size_set(ep_addr_to_nrfx(ep_cfg->ep_addr),
ep_cfg->ep_mps);