diff options
| author | hathach <[email protected]> | 2025-12-10 18:49:39 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-12-10 18:49:39 +0700 |
| commit | 8d0fda879b68e0d5f905590ec1ae5124e4054e48 (patch) | |
| tree | 67a0c1c64bb74bc105dca007909fd8b06529417a /src/common | |
| parent | a165cf26b269efa396667b05f5ccedace9b528ca (diff) | |
only validate endpoint tu_edpt_validate() when debug enabled
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_private.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h index dc62ae848..cc5c7d46a 100644 --- a/src/common/tusb_private.h +++ b/src/common/tusb_private.h @@ -62,7 +62,7 @@ typedef struct TU_ATTR_PACKED { volatile uint8_t busy : 1; volatile uint8_t stalled : 1; volatile uint8_t claimed : 1; -}tu_edpt_state_t; +} tu_edpt_state_t; typedef struct { struct TU_ATTR_PACKED { @@ -84,8 +84,18 @@ typedef struct { // Endpoint //--------------------------------------------------------------------+ -// Check if endpoint descriptor is valid per USB specs +// Check if endpoint descriptor is valid per USB specs if debug is enabled +#if CFG_TUSB_DEBUG bool tu_edpt_validate(tusb_desc_endpoint_t const * desc_ep, tusb_speed_t speed, bool is_host); +#else +TU_ATTR_ALWAYS_INLINE static inline bool tu_edpt_validate(tusb_desc_endpoint_t const *desc_ep, tusb_speed_t speed, + bool is_host) { + (void)desc_ep; + (void)speed; + (void)is_host; + return true; +} +#endif // Bind all endpoint of a interface descriptor to class driver void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* p_desc, uint16_t desc_len, uint8_t driver_id); |
