summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-09-25 16:16:55 +0700
committerhathach <[email protected]>2021-09-25 16:16:55 +0700
commit73872a5df04a8939d5f71509788c659e38efcecd (patch)
treed1841cea6736268a41f80efe108c393a8a9f0d18 /src
parent1c17cb1c451f8564623fef09fa4bd74a0e2a30da (diff)
add CFG_TUSB_OS_INC_PATH for os include path
useful for freertos/ prefix with esp IDF
Diffstat (limited to 'src')
-rw-r--r--src/common/tusb_compiler.h3
-rw-r--r--src/osal/osal_freertos.h8
-rw-r--r--src/tusb_option.h6
3 files changed, 13 insertions, 4 deletions
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index d3adbbc2d..3e85939b0 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -32,6 +32,7 @@
#ifndef _TUSB_COMPILER_H_
#define _TUSB_COMPILER_H_
+#define TU_TOKEN(x) x
#define TU_STRING(x) #x ///< stringify without expand
#define TU_XSTRING(x) TU_STRING(x) ///< expand then stringify
@@ -41,6 +42,8 @@
#define TU_XSTRCAT(a, b) TU_STRCAT(a, b) ///< expand then concat
#define TU_XSTRCAT3(a, b, c) TU_STRCAT3(a, b, c) ///< expand then concat 3 tokens
+#define TU_INCLUDE_PATH(_dir,_file) TU_XSTRING( TU_TOKEN(_dir)TU_TOKEN(_file) )
+
#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
#define _TU_COUNTER_ __COUNTER__
#else
diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h
index 66070c273..4573e01f5 100644
--- a/src/osal/osal_freertos.h
+++ b/src/osal/osal_freertos.h
@@ -28,10 +28,10 @@
#define _TUSB_OSAL_FREERTOS_H_
// FreeRTOS Headers
-#include "FreeRTOS.h"
-#include "semphr.h"
-#include "queue.h"
-#include "task.h"
+#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,FreeRTOS.h)
+#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,semphr.h)
+#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,queue.h)
+#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,task.h)
#ifdef __cplusplus
extern "C" {
diff --git a/src/tusb_option.h b/src/tusb_option.h
index a00f3489f..ad2a26a66 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -203,14 +203,20 @@
#define CFG_TUSB_MEM_SECTION
#endif
+// alignment requirement of buffer used for endpoint transferring
#ifndef CFG_TUSB_MEM_ALIGN
#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
+// OS selection
#ifndef CFG_TUSB_OS
#define CFG_TUSB_OS OPT_OS_NONE
#endif
+#ifndef CFG_TUSB_OS_INC_PATH
+ #define CFG_TUSB_OS_INC_PATH
+#endif
+
//--------------------------------------------------------------------
// DEVICE OPTIONS
//--------------------------------------------------------------------