Merge branch 'master' into enhance
This commit is contained in:
		| @@ -7,12 +7,18 @@ FREERTOS_SRC = lib/FreeRTOS-Kernel | ||||
|  | ||||
| INC += \ | ||||
| 	src \ | ||||
| 	src/FreeRTOSConfig \ | ||||
| 	$(TOP)/hw \ | ||||
| 	$(TOP)/$(FREERTOS_SRC)/include \ | ||||
| 	$(TOP)/$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT) | ||||
| 	 | ||||
| # Example source | ||||
| EXAMPLE_SOURCE += $(wildcard src/*.c) | ||||
| EXAMPLE_SOURCE = \ | ||||
| 	src/freertos_hook.c \ | ||||
| 	src/main.c \ | ||||
| 	src/msc_disk.c \ | ||||
| 	src/usb_descriptors.c | ||||
|  | ||||
| SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) | ||||
|  | ||||
| # FreeRTOS source, all files in port folder | ||||
|   | ||||
| @@ -8,9 +8,7 @@ if(EXISTS ${board_cmake}) | ||||
|     include(${board_cmake}) | ||||
| endif() | ||||
|  | ||||
| idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) | ||||
| target_include_directories(${COMPONENT_TARGET} PUBLIC | ||||
|   "${FREERTOS_ORIG_INCLUDE_PATH}" | ||||
|   "${TOP}/hw" | ||||
|   "${TOP}/src" | ||||
| ) | ||||
|   | ||||
| @@ -45,6 +45,10 @@ | ||||
| // Include MCU header
 | ||||
| #include "bsp/board_mcu.h" | ||||
| 
 | ||||
| #if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3 | ||||
| #error "ESP32-Sx should use IDF's FreeRTOSConfig.h" | ||||
| #endif | ||||
| 
 | ||||
| extern uint32_t SystemCoreClock; | ||||
| 
 | ||||
| /* Cortex M23/M33 port configuration. */ | ||||
| @@ -27,15 +27,25 @@ | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "FreeRTOS.h" | ||||
| #include "task.h" | ||||
| #include "timers.h" | ||||
| #include "queue.h" | ||||
| #include "semphr.h" | ||||
|  | ||||
| #include "bsp/board.h" | ||||
| #include "tusb.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 | ||||
| //--------------------------------------------------------------------+ | ||||
| @@ -95,7 +105,7 @@ int main(void) | ||||
|   (void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef); | ||||
|  | ||||
|   // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3 | ||||
| #if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3 | ||||
| #if !( TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) ) | ||||
|   vTaskStartScheduler(); | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -67,6 +67,11 @@ | ||||
| // This examples use FreeRTOS | ||||
| #define CFG_TUSB_OS               OPT_OS_FREERTOS | ||||
|  | ||||
| // Espressif IDF requires "freertos/" prefix in include path | ||||
| #if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) | ||||
|   #define CFG_TUSB_OS_INC_PATH    freertos/ | ||||
| #endif | ||||
|  | ||||
| // can be defined by compiler in DEBUG build | ||||
| #ifndef CFG_TUSB_DEBUG | ||||
|   #define CFG_TUSB_DEBUG           0 | ||||
|   | ||||
| @@ -6,7 +6,7 @@ INC += \ | ||||
| 	$(TOP)/hw \ | ||||
|  | ||||
| # Example source | ||||
| EXAMPLE_SOURCE += \ | ||||
| EXAMPLE_SOURCE = \ | ||||
| 	src/main.c \ | ||||
| 	src/usb_descriptors.c | ||||
| 	 | ||||
|   | ||||
| @@ -7,12 +7,17 @@ FREERTOS_SRC = lib/FreeRTOS-Kernel | ||||
|  | ||||
| INC += \ | ||||
| 	src \ | ||||
| 	src/FreeRTOSConfig \ | ||||
| 	$(TOP)/hw \ | ||||
| 	$(TOP)/$(FREERTOS_SRC)/include \ | ||||
| 	$(TOP)/$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)	 | ||||
|  | ||||
| # Example source | ||||
| EXAMPLE_SOURCE += $(wildcard src/*.c) | ||||
| EXAMPLE_SOURCE = \ | ||||
| 	src/freertos_hook.c \ | ||||
| 	src/main.c \ | ||||
| 	src/usb_descriptors.c | ||||
| 	 | ||||
| SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE)) | ||||
|  | ||||
| # FreeRTOS source, all files in port folder | ||||
|   | ||||
| @@ -8,9 +8,7 @@ if(EXISTS ${board_cmake}) | ||||
|     include(${board_cmake}) | ||||
| endif() | ||||
|  | ||||
| idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) | ||||
| target_include_directories(${COMPONENT_TARGET} PUBLIC | ||||
|   "${FREERTOS_ORIG_INCLUDE_PATH}" | ||||
|   "${TOP}/hw" | ||||
|   "${TOP}/src" | ||||
| ) | ||||
|   | ||||
| @@ -45,6 +45,10 @@ | ||||
| // Include MCU header
 | ||||
| #include "bsp/board_mcu.h" | ||||
| 
 | ||||
| #if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3 | ||||
| #error "ESP32-Sx should use IDF's FreeRTOSConfig.h" | ||||
| #endif | ||||
| 
 | ||||
| extern uint32_t SystemCoreClock; | ||||
| 
 | ||||
| /* Cortex M23/M33 port configuration. */ | ||||
| @@ -27,17 +27,26 @@ | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "FreeRTOS.h" | ||||
| #include "task.h" | ||||
| #include "timers.h" | ||||
| #include "queue.h" | ||||
| #include "semphr.h" | ||||
|  | ||||
| #include "bsp/board.h" | ||||
| #include "tusb.h" | ||||
|  | ||||
| #include "usb_descriptors.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 | ||||
| //--------------------------------------------------------------------+ | ||||
| @@ -96,7 +105,7 @@ int main(void) | ||||
|   (void) xTaskCreateStatic( hid_task, "hid", HID_STACK_SZIE, NULL, configMAX_PRIORITIES-2, hid_stack, &hid_taskdef); | ||||
|  | ||||
|   // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3 | ||||
| #if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3 | ||||
| #if !( TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) ) | ||||
|   vTaskStartScheduler(); | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -67,6 +67,12 @@ | ||||
| // This examples use FreeRTOS | ||||
| #define CFG_TUSB_OS               OPT_OS_FREERTOS | ||||
|  | ||||
| // Espressif IDF requires "freertos/" prefix in include path | ||||
| #if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) | ||||
|   #define CFG_TUSB_OS_INC_PATH    freertos/ | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifndef CFG_TUSB_DEBUG | ||||
| #define CFG_TUSB_DEBUG           0 | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach