Skip to content

Commit ee1a5db

Browse files
authored
Merge pull request #3084 from joelpmichael/hcd-template-comments
note potential issues using ep_desc in hcd_edpt_open()
2 parents 91163c9 + b6abc90 commit ee1a5db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/portable/template/hcd_template.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
106106
// Open an endpoint
107107
bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc) {
108108
(void) rhport; (void) dev_addr; (void) ep_desc;
109+
110+
// NOTE: ep_desc is allocated on the stack when called from usbh_edpt_control_open()
111+
// You need to copy the data into a local variable who maintains the state of the endpoint and transfer.
112+
// Check _hcd_data in hcd_dwc2.c for example.
113+
109114
return false;
110115
}
111116

0 commit comments

Comments
 (0)