Skip to content

Commit f384d6f

Browse files
committed
more with clean up
1 parent b36b211 commit f384d6f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/common/tusb_fifo.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
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

src/common/tusb_fifo.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
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,
@@ -37,17 +41,12 @@
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);
127126
bool tu_fifo_overflowed (tu_fifo_t* f);
128127
void tu_fifo_correct_read_pointer (tu_fifo_t* f);
129128

130-
static inline
129+
TU_ATTR_ALWAYS_INLINE static inline
131130
uint16_t tu_fifo_depth(tu_fifo_t* f)
132131
{
133132
return f->depth;

0 commit comments

Comments
 (0)