فهرست منبع

Merge pull request #1108 from hathach/minor-changes

make freertos header include in examples more explicit
Ha Thach 4 سال پیش
والد
کامیت
8f0cfc8d44
2فایلهای تغییر یافته به همراه30 افزوده شده و 14 حذف شده
  1. 15 7
      examples/device/cdc_msc_freertos/src/main.c
  2. 15 7
      examples/device/hid_composite_freertos/src/main.c

+ 15 - 7
examples/device/cdc_msc_freertos/src/main.c

@@ -30,13 +30,21 @@
 #include "bsp/board.h"
 #include "tusb.h"
 
-// FreeRTOS headers, MCUs such as esp32sx requires "freertos/" prefix in include path.
-// CFG_TUSB_OS_INC_PATH should be defined accordingly.
-#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)
-#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,timers.h)
+#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
+  // ESP-IDF need "freertos/" prefix in include path.
+  // CFG_TUSB_OS_INC_PATH should be defined accordingly.
+  #include "freertos/FreeRTOS.h"
+  #include "freertos/semphr.h"
+  #include "freertos/queue.h"
+  #include "freertos/task.h"
+  #include "freertos/timers.h"
+#else
+  #include "FreeRTOS.h"
+  #include "semphr.h"
+  #include "queue.h"
+  #include "task.h"
+  #include "timers.h"
+#endif
 
 //--------------------------------------------------------------------+
 // MACRO CONSTANT TYPEDEF PROTYPES

+ 15 - 7
examples/device/hid_composite_freertos/src/main.c

@@ -31,13 +31,21 @@
 #include "tusb.h"
 #include "usb_descriptors.h"
 
-// FreeRTOS headers, MCUs such as esp32sx requires "freertos/" prefix in include path.
-// CFG_TUSB_OS_INC_PATH should be defined accordingly.
-#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)
-#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,timers.h)
+#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
+  // ESP-IDF need "freertos/" prefix in include path.
+  // CFG_TUSB_OS_INC_PATH should be defined accordingly.
+  #include "freertos/FreeRTOS.h"
+  #include "freertos/semphr.h"
+  #include "freertos/queue.h"
+  #include "freertos/task.h"
+  #include "freertos/timers.h"
+#else
+  #include "FreeRTOS.h"
+  #include "semphr.h"
+  #include "queue.h"
+  #include "task.h"
+  #include "timers.h"
+#endif
 
 //--------------------------------------------------------------------+
 // MACRO CONSTANT TYPEDEF PROTYPES