diff options
| author | hathach <[email protected]> | 2021-05-27 00:13:07 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-05-27 00:16:45 +0700 |
| commit | c7cecf28c8bd409c3032a11180333654c90020d4 (patch) | |
| tree | eb28837d0922f0d384efe3d1e0dabf697f9a1e54 /src/common | |
| parent | 814edec89f5440b5dad43cc405e97af4f8fae175 (diff) | |
clean up
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_fifo.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h index 8d73911f0..1f9da94d1 100644 --- a/src/common/tusb_fifo.h +++ b/src/common/tusb_fifo.h @@ -53,9 +53,6 @@ extern "C" { #define tu_fifo_mutex_t osal_mutex_t #endif -/** \struct tu_fifo_t - * \brief Simple Circular FIFO - */ typedef struct { uint8_t* buffer ; ///< buffer pointer @@ -104,7 +101,8 @@ bool tu_fifo_clear(tu_fifo_t *f); bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_size, bool overwritable); #if CFG_FIFO_MUTEX -static inline void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t write_mutex_hdl, tu_fifo_mutex_t read_mutex_hdl) +TU_ATTR_ALWAYS_INLINE static inline +void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t write_mutex_hdl, tu_fifo_mutex_t read_mutex_hdl) { f->mutex_wr = write_mutex_hdl; f->mutex_rd = read_mutex_hdl; @@ -129,15 +127,16 @@ uint16_t tu_fifo_remaining (tu_fifo_t* f); bool tu_fifo_overflowed (tu_fifo_t* f); void tu_fifo_correct_read_pointer (tu_fifo_t* f); -static inline uint16_t tu_fifo_depth(tu_fifo_t* f) +static inline +uint16_t tu_fifo_depth(tu_fifo_t* f) { return f->depth; } // Pointer modifications intended to be used in combinations with DMAs. // USE WITH CARE - NO SAFTY CHECKS CONDUCTED HERE! NOT MUTEX PROTECTED! -void tu_fifo_advance_write_pointer (tu_fifo_t *f, uint16_t n); -void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n); +void tu_fifo_advance_write_pointer(tu_fifo_t *f, uint16_t n); +void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n); // If you want to read/write from/to the FIFO by use of a DMA, you may need to conduct two copies // to handle a possible wrapping part. These functions deliver a pointer to start |
