summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorJoel Michael <[email protected]>2025-04-16 20:26:35 +1000
committerJoel Michael <[email protected]>2025-04-16 20:26:35 +1000
commit0d2c08efd7145b160ab0ed373b2cf956699cfb74 (patch)
treee2501451a180304000e7052023812ff74422a6cc /src/portable
parentb8d3c0c4a8e005bcfcc4ed04556e6da54f235ccc (diff)
note potential issues using ep_desc in hcd_edpt_open()
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/template/hcd_template.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/template/hcd_template.c b/src/portable/template/hcd_template.c
index b073d6057..694fa8550 100644
--- a/src/portable/template/hcd_template.c
+++ b/src/portable/template/hcd_template.c
@@ -116,6 +116,10 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc) {
(void) rhport;
(void) dev_addr;
+
+ // NOTE: ep_desc is allocated on the stack when called from usbh_edpt_control_open()
+ // If you need to persist any ep_desc values across HCD calls (eg ep_desc->wMaxPacketSize),
+ // then you need to copy the data into another variable inside this function.
(void) ep_desc;
return false;