drivers: udc_stm32: handle ZLP flag

A function, such as CDC ECM, can set the ZLP flag to handle a
class-specific protocol. This is not to be confused with the ZLP role in
control transfers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2024-03-02 10:37:51 +01:00 committed by Anas Nashif
commit 6aaad0a5cd

View file

@ -322,6 +322,13 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
return;
}
if (udc_ep_buf_has_zlp(buf) && ep != USB_CONTROL_EP_IN) {
udc_ep_buf_clear_zlp(buf);
HAL_PCD_EP_Transmit(&priv->pcd, ep, buf->data, 0);
return;
}
udc_buf_get(dev, ep);
if (ep == USB_CONTROL_EP_IN) {