Skip to content

Commit 6aaad0a

Browse files
jfischer-nonashif
authored andcommitted
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 <[email protected]>
1 parent de728c3 commit 6aaad0a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/udc/udc_stm32.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,13 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
322322
return;
323323
}
324324

325+
if (udc_ep_buf_has_zlp(buf) && ep != USB_CONTROL_EP_IN) {
326+
udc_ep_buf_clear_zlp(buf);
327+
HAL_PCD_EP_Transmit(&priv->pcd, ep, buf->data, 0);
328+
329+
return;
330+
}
331+
325332
udc_buf_get(dev, ep);
326333

327334
if (ep == USB_CONTROL_EP_IN) {

0 commit comments

Comments
 (0)