diff options
| author | hathach <[email protected]> | 2024-09-10 18:37:53 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-09-10 18:37:53 +0700 |
| commit | dd1822ba032e3e86efd445cda1c3fd0e8f342bbc (patch) | |
| tree | 33f5e70de8ca4f51e994fe1e333c997841c206df /src/common | |
| parent | 3ab63fbc65ce1d6333594fec23f1e2239588ea31 (diff) | |
reduce ep stream footprint by using is_mps512 since it only support bulk so far
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_private.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h index 2cf11ea94..8a479c042 100644 --- a/src/common/tusb_private.h +++ b/src/common/tusb_private.h @@ -41,13 +41,14 @@ typedef struct TU_ATTR_PACKED { }tu_edpt_state_t; typedef struct { - uint8_t is_host; // 1: host, 0: device + struct TU_ATTR_PACKED { + uint8_t is_host : 1; // 1: host, 0: device + uint8_t is_mps512 : 1; // 1: 512, 0: 64 since stream is used for Bulk only + }; uint8_t ep_addr; - - uint16_t ep_packetsize; uint16_t ep_bufsize; - uint8_t* ep_buf; // TODO xfer_fifo can skip this buffer + uint8_t* ep_buf; // TODO xfer_fifo can skip this buffer tu_fifo_t ff; // mutex: read if rx, otherwise write @@ -90,7 +91,7 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_edpt_stream_open(tu_edpt_stream_t* s, tusb_desc_endpoint_t const *desc_ep) { tu_fifo_clear(&s->ff); s->ep_addr = desc_ep->bEndpointAddress; - s->ep_packetsize = tu_edpt_packet_size(desc_ep); + s->is_mps512 = (tu_edpt_packet_size(desc_ep) == 512) ? 1 : 0; } TU_ATTR_ALWAYS_INLINE static inline |
