File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 2525 * This file is part of the TinyUSB stack.
2626 */
2727
28- #include <string.h>
29-
3028#include "osal/osal.h"
3129#include "tusb_fifo.h"
3230
Original file line number Diff line number Diff line change 2828#ifndef _TUSB_FIFO_H_
2929#define _TUSB_FIFO_H_
3030
31+ #ifdef __cplusplus
32+ extern "C" {
33+ #endif
34+
3135// Due to the use of unmasked pointers, this FIFO does not suffer from loosing
3236// one item slice. Furthermore, write and read operations are completely
3337// decoupled as write and read functions do not modify a common state. Henceforth,
3741// read pointers can be updated from within a DMA ISR. Overflows are detectable
3842// within a certain number (see tu_fifo_overflow()).
3943
44+ #include "common/tusb_common.h"
45+
4046// mutex is only needed for RTOS
4147// for OS None, we don't get preempted
4248#define CFG_FIFO_MUTEX (CFG_TUSB_OS != OPT_OS_NONE)
4349
44- #include <stdint.h>
45- #include <stdbool.h>
46-
47- #ifdef __cplusplus
48- extern "C" {
49- #endif
50-
5150#if CFG_FIFO_MUTEX
5251#include "osal/osal.h"
5352#define tu_fifo_mutex_t osal_mutex_t
@@ -127,7 +126,7 @@ uint16_t tu_fifo_remaining (tu_fifo_t* f);
127126bool tu_fifo_overflowed (tu_fifo_t * f );
128127void tu_fifo_correct_read_pointer (tu_fifo_t * f );
129128
130- static inline
129+ TU_ATTR_ALWAYS_INLINE static inline
131130uint16_t tu_fifo_depth (tu_fifo_t * f )
132131{
133132 return f -> depth ;
You can’t perform that action at this time.
0 commit comments