27#ifndef TUSB_OSAL_NONE_H_
28#define TUSB_OSAL_NONE_H_
73 while (sem_hdl->count == 0) {}
90#if OSAL_MUTEX_REQUIRED
114#define osal_mutex_create(_mdef) (NULL)
115#define osal_mutex_lock(_mutex_hdl, _ms) (true)
116#define osal_mutex_unlock(_mutex_hdl) (true)
126 void (* interrupt_set)(bool);
133#define OSAL_QUEUE_DEF(_int_set, _name, _depth, _type) \
134 uint8_t _name##_buf[_depth*sizeof(_type)]; \
135 osal_queue_def_t _name = { \
136 .interrupt_set = _int_set, \
137 .ff = TU_FIFO_INIT(_name##_buf, _depth, _type, false) \
143 qhdl->interrupt_set(
false);
149 qhdl->interrupt_set(
true);
StaticSemaphore_t osal_semaphore_def_t
StaticSemaphore_t osal_mutex_def_t
QueueHandle_t osal_queue_t
SemaphoreHandle_t osal_semaphore_t
SemaphoreHandle_t osal_mutex_t
osal_semaphore_def_t osal_mutex_def_t
static TU_ATTR_ALWAYS_INLINE bool osal_queue_empty(osal_queue_t qhdl)
static TU_ATTR_ALWAYS_INLINE bool osal_semaphore_delete(osal_semaphore_t semd_hdl)
static TU_ATTR_ALWAYS_INLINE void _osal_q_lock(osal_queue_t qhdl)
static TU_ATTR_ALWAYS_INLINE bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec)
static TU_ATTR_ALWAYS_INLINE osal_queue_t osal_queue_create(osal_queue_def_t *qdef)
static TU_ATTR_ALWAYS_INLINE bool osal_mutex_lock(osal_mutex_t mutex_hdl, uint32_t msec)
static TU_ATTR_ALWAYS_INLINE bool osal_queue_send(osal_queue_t qhdl, void const *data, bool in_isr)
osal_semaphore_t osal_mutex_t
osal_queue_def_t * osal_queue_t
static TU_ATTR_ALWAYS_INLINE bool osal_mutex_unlock(osal_mutex_t mutex_hdl)
TU_ATTR_WEAK void osal_task_delay(uint32_t msec)
static TU_ATTR_ALWAYS_INLINE bool osal_mutex_delete(osal_mutex_t mutex_hdl)
static TU_ATTR_ALWAYS_INLINE bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
static TU_ATTR_ALWAYS_INLINE bool osal_queue_receive(osal_queue_t qhdl, void *data, uint32_t msec)
static TU_ATTR_ALWAYS_INLINE bool osal_queue_delete(osal_queue_t qhdl)
static TU_ATTR_ALWAYS_INLINE void _osal_q_unlock(osal_queue_t qhdl)
static TU_ATTR_ALWAYS_INLINE osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t *semdef)
static TU_ATTR_ALWAYS_INLINE void osal_semaphore_reset(osal_semaphore_t sem_hdl)
osal_semaphore_def_t * osal_semaphore_t
static TU_ATTR_ALWAYS_INLINE osal_mutex_t osal_mutex_create(osal_mutex_def_t *mdef)
bool tu_fifo_read(tu_fifo_t *f, void *buffer)
Read one element out of the buffer.
bool tu_fifo_empty(tu_fifo_t *f)
Check if FIFO is empty.
bool tu_fifo_write(tu_fifo_t *f, const void *data)
Write one element into the buffer.
bool tu_fifo_clear(tu_fifo_t *f)
Clear the fifo read and write pointers.