Skip to content

Commit eeef6f7

Browse files
authored
Merge pull request #134 from aitap/ep_write_0_0_doc
Document the usbd_ep_write(dev, ep, 0, 0) trick
2 parents 343a474 + 8aa2ab8 commit eeef6f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/usbd_core.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ typedef int32_t (*usbd_hw_ep_read)(uint8_t ep, void *buf, uint16_t blen);
269269
* \param buf pointer to data buffer
270270
* \param blen size of data will be written
271271
* \return number of written bytes
272+
*
273+
* The \ref usbd_evt_eptx event will fire for the endpoint once the
274+
* write is \e complete. A trick commonly used is to enqueue a zero-length
275+
* write as soon as the endpoint is configured, so that it would
276+
* "complete", firing an event, the next time an IN request arrives.
272277
*/
273278
typedef int32_t (*usbd_hw_ep_write)(uint8_t ep, const void *buf, uint16_t blen);
274279

0 commit comments

Comments
 (0)