From 8aa2ab8d9777781f2ccc843ed660f07bfa494f05 Mon Sep 17 00:00:00 2001 From: Ivan K Date: Wed, 28 Feb 2024 16:33:40 +0300 Subject: [PATCH] Document the usbd_ep_write(dev, ep, 0, 0) trick --- inc/usbd_core.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/usbd_core.h b/inc/usbd_core.h index 587509f..bc30b86 100644 --- a/inc/usbd_core.h +++ b/inc/usbd_core.h @@ -269,6 +269,11 @@ typedef int32_t (*usbd_hw_ep_read)(uint8_t ep, void *buf, uint16_t blen); * \param buf pointer to data buffer * \param blen size of data will be written * \return number of written bytes + * + * The \ref usbd_evt_eptx event will fire for the endpoint once the + * write is \e complete. A trick commonly used is to enqueue a zero-length + * write as soon as the endpoint is configured, so that it would + * "complete", firing an event, the next time an IN request arrives. */ typedef int32_t (*usbd_hw_ep_write)(uint8_t ep, const void *buf, uint16_t blen);