summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-05-27 18:04:28 +0700
committerhathach <[email protected]>2021-05-27 18:11:12 +0700
commitf384d6f67e200b855e7b07a1fc3218c874e43a42 (patch)
tree636f99d819b3ae0ecc74f73b80b83b780ea73943
parentb36b211c26d807214da1132b41669915fbd21c83 (diff)
more with clean up
-rw-r--r--src/common/tusb_fifo.c2
-rw-r--r--src/common/tusb_fifo.h15
2 files changed, 7 insertions, 10 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c
index 5f7b6a26d..1eb886aa1 100644
--- a/src/common/tusb_fifo.c
+++ b/src/common/tusb_fifo.c
@@ -25,8 +25,6 @@
* This file is part of the TinyUSB stack.
*/
-#include <string.h>
-
#include "osal/osal.h"
#include "tusb_fifo.h"
diff --git a/src/common/tusb_fifo.h b/src/common/tusb_fifo.h
index 1f9da94d1..cf299269d 100644
--- a/src/common/tusb_fifo.h
+++ b/src/common/tusb_fifo.h
@@ -28,6 +28,10 @@
#ifndef _TUSB_FIFO_H_
#define _TUSB_FIFO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Due to the use of unmasked pointers, this FIFO does not suffer from loosing
// one item slice. Furthermore, write and read operations are completely
// decoupled as write and read functions do not modify a common state. Henceforth,
@@ -37,17 +41,12 @@
// read pointers can be updated from within a DMA ISR. Overflows are detectable
// within a certain number (see tu_fifo_overflow()).
+#include "common/tusb_common.h"
+
// mutex is only needed for RTOS
// for OS None, we don't get preempted
#define CFG_FIFO_MUTEX (CFG_TUSB_OS != OPT_OS_NONE)
-#include <stdint.h>
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#if CFG_FIFO_MUTEX
#include "osal/osal.h"
#define tu_fifo_mutex_t osal_mutex_t
@@ -127,7 +126,7 @@ 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
+TU_ATTR_ALWAYS_INLINE static inline
uint16_t tu_fifo_depth(tu_fifo_t* f)
{
return f->depth;