diff options
| author | hathach <[email protected]> | 2024-09-10 18:13:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-09-10 18:13:38 +0700 |
| commit | 7373a0239645b48bbd1c11e9542699924e1f3a0d (patch) | |
| tree | 2565dca7824de322c94f1a6f4a2d7756acbed0c0 /src | |
| parent | bbeae09259707ba6b79db55dda2fd89b9e99f14f (diff) | |
minor clean up
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_private.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/common/tusb_private.h b/src/common/tusb_private.h index 71a395c79..ce42d7ef6 100644 --- a/src/common/tusb_private.h +++ b/src/common/tusb_private.h @@ -34,29 +34,24 @@ extern "C" { #endif -typedef struct TU_ATTR_PACKED -{ +typedef struct TU_ATTR_PACKED { volatile uint8_t busy : 1; volatile uint8_t stalled : 1; volatile uint8_t claimed : 1; }tu_edpt_state_t; typedef struct { - struct { - uint8_t is_host : 1; // host or device - uint8_t is_highspeed: 1; // is highspeed - }; + uint8_t is_host; // 1: host, 0: device uint8_t ep_addr; uint16_t ep_packetsize; uint16_t ep_bufsize; - // TODO xfer_fifo can skip this buffer - uint8_t* ep_buf; + uint8_t* ep_buf; // TODO xfer_fifo can skip this buffer tu_fifo_t ff; - // mutex: read if ep rx, write if e tx + // mutex: read if rx, otherwise write OSAL_MUTEX_DEF(ff_mutexdef); }tu_edpt_stream_t; @@ -92,7 +87,6 @@ bool tu_edpt_stream_init(tu_edpt_stream_t* s, bool is_host, bool is_tx, bool ove bool tu_edpt_stream_deinit(tu_edpt_stream_t* s); // Open an stream for an endpoint -// hwid is either device address (host mode) or rhport (device mode) 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); |
