summaryrefslogtreecommitdiff
path: root/src/device/dcd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-19 11:32:44 +0700
committerhathach <[email protected]>2025-11-19 11:32:44 +0700
commitfd3161087d76c84fb21e8e2f2d30a81d6b11bfba (patch)
tree527172cad87c76062490e4ecc9277e21d3691224 /src/device/dcd.h
parentbe4b38c54dc4e23af322ae04eda1f30e5ced0289 (diff)
parentd46f71bdde8b3160b0efaf83598d6b4cf596f787 (diff)
Merge branch 'refs/heads/master' into dwc2_ep0
# Conflicts: # examples/device/dfu/src/usb_descriptors.c # examples/device/dfu_runtime/src/usb_descriptors.c # src/device/usbd_control.c # src/portable/synopsys/dwc2/dcd_dwc2.c
Diffstat (limited to 'src/device/dcd.h')
-rw-r--r--src/device/dcd.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h
index 436c4555f..353f836ee 100644
--- a/src/device/dcd.h
+++ b/src/device/dcd.h
@@ -171,7 +171,12 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr);
// This API never calls with control endpoints, since it is auto cleared when receiving setup packet
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr);
-#ifdef TUP_DCD_EDPT_ISO_ALLOC
+#ifdef TUP_DCD_EDPT_CLOSE_API
+// Close an endpoint.
+void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr);
+
+#else
+
// Allocate packet buffer used by ISO endpoints
// Some MCU need manual packet buffer allocation, we allocate the largest size to avoid clustering
bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size);
@@ -179,10 +184,6 @@ bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet
// Configure and enable an ISO endpoint according to descriptor
bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep);
-#else
-// Close an endpoint.
-void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr);
-
#endif
//--------------------------------------------------------------------+
@@ -214,7 +215,7 @@ TU_ATTR_ALWAYS_INLINE static inline void dcd_event_setup_received(uint8_t rhport
dcd_event_t event;
event.rhport = rhport;
event.event_id = DCD_EVENT_SETUP_RECEIVED;
- memcpy(&event.setup_received, setup, sizeof(tusb_control_request_t));
+ (void) memcpy(&event.setup_received, setup, sizeof(tusb_control_request_t));
dcd_event_handler(&event, in_isr);
}