Skip to content

Commit 9c73c1a

Browse files
committed
minor clean up
1 parent b42d298 commit 9c73c1a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/common/tusb_fifo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
// implement mutex lock and unlock
4040
#if CFG_FIFO_MUTEX
4141

42-
static inline void _ff_lock(tu_fifo_mutex_t mutex)
42+
static inline void _ff_lock(osal_mutex_t mutex)
4343
{
4444
if (mutex) osal_mutex_lock(mutex, OSAL_TIMEOUT_WAIT_FOREVER);
4545
}
4646

47-
static inline void _ff_unlock(tu_fifo_mutex_t mutex)
47+
static inline void _ff_unlock(osal_mutex_t mutex)
4848
{
4949
if (mutex) osal_mutex_unlock(mutex);
5050
}

src/common/tusb_fifo.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ extern "C" {
4444
#include "common/tusb_common.h"
4545
#include "osal/osal.h"
4646

47-
#define tu_fifo_mutex_t osal_mutex_t
48-
4947
// mutex is only needed for RTOS
5048
// for OS None, we don't get preempted
5149
#define CFG_FIFO_MUTEX OSAL_MUTEX_REQUIRED
@@ -121,8 +119,8 @@ typedef struct
121119
volatile uint16_t rd_idx ; ///< read index
122120

123121
#if OSAL_MUTEX_REQUIRED
124-
tu_fifo_mutex_t mutex_wr;
125-
tu_fifo_mutex_t mutex_rd;
122+
osal_mutex_t mutex_wr;
123+
osal_mutex_t mutex_rd;
126124
#endif
127125

128126
} tu_fifo_t;
@@ -155,7 +153,7 @@ bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_si
155153

156154
#if OSAL_MUTEX_REQUIRED
157155
TU_ATTR_ALWAYS_INLINE static inline
158-
void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t wr_mutex, tu_fifo_mutex_t rd_mutex)
156+
void tu_fifo_config_mutex(tu_fifo_t *f, osal_mutex_t wr_mutex, osal_mutex_t rd_mutex)
159157
{
160158
f->mutex_wr = wr_mutex;
161159
f->mutex_rd = rd_mutex;

0 commit comments

Comments
 (0)