Merge pull request #3084 from joelpmichael/hcd-template-comments

note potential issues using ep_desc in hcd_edpt_open()
This commit is contained in:
HiFiPhile 2025-04-18 11:25:59 +02:00 committed by GitHub
commit ee1a5dbac0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -106,6 +106,11 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
// Open an endpoint
bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc) {
(void) rhport; (void) dev_addr; (void) ep_desc;
// NOTE: ep_desc is allocated on the stack when called from usbh_edpt_control_open()
// You need to copy the data into a local variable who maintains the state of the endpoint and transfer.
// Check _hcd_data in hcd_dwc2.c for example.
return false;
}