From 64c2aa15aa28f71b407f2f2faa25b468197c321f Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 26 Apr 2019 18:12:35 +0200 Subject: [PATCH] Rename Kconfig options (components/freertos) --- components/esp32/Kconfig | 2 +- components/freertos/Kconfig | 12 ++++++------ .../freertos/include/freertos/FreeRTOSConfig.h | 10 +++++----- components/freertos/sdkconfig.rename | 8 ++++++++ components/pthread/CMakeLists.txt | 2 +- components/pthread/component.mk | 2 +- components/pthread/pthread_local_storage.c | 6 +++--- docs/en/api-guides/freertos-smp.rst | 4 ++-- tools/ldgen/samples/sdkconfig | 8 ++++---- tools/unit-test-app/sdkconfig.defaults | 2 +- 10 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 components/freertos/sdkconfig.rename diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index b22c73940d..643f241ded 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -68,7 +68,7 @@ menu "ESP32-specific" bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)" config SPIRAM_USE_MALLOC bool "Make RAM allocatable using malloc() as well" - select SUPPORT_STATIC_ALLOCATION + select FREERTOS_SUPPORT_STATIC_ALLOCATION endchoice choice SPIRAM_TYPE diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 343fc89ac6..9aaebdae57 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -192,7 +192,7 @@ menu "FreeRTOS" For most uses, the default of 16 is OK. - config SUPPORT_STATIC_ALLOCATION + config FREERTOS_SUPPORT_STATIC_ALLOCATION bool "Enable FreeRTOS static allocation API" default n help @@ -220,9 +220,9 @@ menu "FreeRTOS" applications that simply don't allow any dynamic memory allocation (although FreeRTOS includes allocation schemes that can overcome most objections). - config ENABLE_STATIC_TASK_CLEAN_UP_HOOK + config FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP bool "Enable static task clean up hook" - depends on SUPPORT_STATIC_ALLOCATION + depends on FREERTOS_SUPPORT_STATIC_ALLOCATION default n help Enable this option to make FreeRTOS call the static task clean up hook when a task is deleted. @@ -233,7 +233,7 @@ menu "FreeRTOS" // place clean up code here } - config TIMER_TASK_PRIORITY + config FREERTOS_TIMER_TASK_PRIORITY int "FreeRTOS timer task priority" range 1 25 default 1 @@ -244,7 +244,7 @@ menu "FreeRTOS" Use this constant to define the priority that the timer task will run at. - config TIMER_TASK_STACK_DEPTH + config FREERTOS_TIMER_TASK_STACK_DEPTH int "FreeRTOS timer task stack size" range 1536 32768 default 2048 @@ -255,7 +255,7 @@ menu "FreeRTOS" Use this constant to define the size (in bytes) of the stack allocated for the timer task. - config TIMER_QUEUE_LENGTH + config FREERTOS_TIMER_QUEUE_LENGTH int "FreeRTOS timer queue length" range 5 20 default 10 diff --git a/components/freertos/include/freertos/FreeRTOSConfig.h b/components/freertos/include/freertos/FreeRTOSConfig.h index 931264bf6c..bd3c72db59 100644 --- a/components/freertos/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/include/freertos/FreeRTOSConfig.h @@ -272,10 +272,10 @@ int xt_clock_freq(void) __attribute__((deprecated)); #define configUSE_NEWLIB_REENTRANT 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configSUPPORT_STATIC_ALLOCATION CONFIG_SUPPORT_STATIC_ALLOCATION +#define configSUPPORT_STATIC_ALLOCATION CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION #ifndef __ASSEMBLER__ -#if CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK +#if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP extern void vPortCleanUpTCB ( void *pxTCB ); #define portCLEAN_UP_TCB( pxTCB ) vPortCleanUpTCB( pxTCB ) #endif @@ -284,9 +284,9 @@ extern void vPortCleanUpTCB ( void *pxTCB ); /* Test FreeRTOS timers (with timer task) and more. */ /* Some files don't compile if this flag is disabled */ #define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY CONFIG_TIMER_TASK_PRIORITY -#define configTIMER_QUEUE_LENGTH CONFIG_TIMER_QUEUE_LENGTH -#define configTIMER_TASK_STACK_DEPTH CONFIG_TIMER_TASK_STACK_DEPTH +#define configTIMER_TASK_PRIORITY CONFIG_FREERTOS_TIMER_TASK_PRIORITY +#define configTIMER_QUEUE_LENGTH CONFIG_FREERTOS_TIMER_QUEUE_LENGTH +#define configTIMER_TASK_STACK_DEPTH CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH #define INCLUDE_xTimerPendFunctionCall 1 #define INCLUDE_eTaskGetState 1 diff --git a/components/freertos/sdkconfig.rename b/components/freertos/sdkconfig.rename new file mode 100644 index 0000000000..aa282d1a96 --- /dev/null +++ b/components/freertos/sdkconfig.rename @@ -0,0 +1,8 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_SUPPORT_STATIC_ALLOCATION CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION +CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP +CONFIG_TIMER_TASK_PRIORITY CONFIG_FREERTOS_TIMER_TASK_PRIORITY +CONFIG_TIMER_TASK_STACK_DEPTH CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH +CONFIG_TIMER_QUEUE_LENGTH CONFIG_FREERTOS_TIMER_QUEUE_LENGTH diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt index cf727293f6..5c8bc04a04 100644 --- a/components/pthread/CMakeLists.txt +++ b/components/pthread/CMakeLists.txt @@ -4,6 +4,6 @@ set(COMPONENT_SRCS "pthread.c" set(COMPONENT_ADD_INCLUDEDIRS "include") register_component() -if(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) target_link_libraries(${COMPONENT_LIB} "-Wl,--wrap=vPortCleanUpTCB") endif() diff --git a/components/pthread/component.mk b/components/pthread/component.mk index 0dd2394810..9c3eececf5 100644 --- a/components/pthread/component.mk +++ b/components/pthread/component.mk @@ -8,6 +8,6 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_ADD_LDFLAGS := -lpthread -ifdef CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK +ifdef CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP COMPONENT_ADD_LDFLAGS += -Wl,--wrap=vPortCleanUpTCB endif diff --git a/components/pthread/pthread_local_storage.c b/components/pthread/pthread_local_storage.c index 06445542dd..5e2dbafd21 100644 --- a/components/pthread/pthread_local_storage.c +++ b/components/pthread/pthread_local_storage.c @@ -142,7 +142,7 @@ static void pthread_local_storage_thread_deleted_callback(int index, void *v_tls free(tls); } -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) /* Called from FreeRTOS task delete hook */ void pthread_local_storage_cleanup(TaskHandle_t task) { @@ -174,7 +174,7 @@ void pthread_internal_local_storage_destructor_callback() /* remove the thread-local-storage pointer to avoid the idle task cleanup calling it again... */ -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) vTaskSetThreadLocalStoragePointer(NULL, PTHREAD_TLS_INDEX, NULL); #else vTaskSetThreadLocalStoragePointerAndDelCallback(NULL, @@ -223,7 +223,7 @@ int pthread_setspecific(pthread_key_t key, const void *value) if (tls == NULL) { return ENOMEM; } -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) vTaskSetThreadLocalStoragePointer(NULL, PTHREAD_TLS_INDEX, tls); #else vTaskSetThreadLocalStoragePointerAndDelCallback(NULL, diff --git a/docs/en/api-guides/freertos-smp.rst b/docs/en/api-guides/freertos-smp.rst index 5e765a00a2..51752170b5 100644 --- a/docs/en/api-guides/freertos-smp.rst +++ b/docs/en/api-guides/freertos-smp.rst @@ -89,7 +89,7 @@ Static Alocation ^^^^^^^^^^^^^^^^^ This feature has been backported from FreeRTOS v9.0.0 to ESP-IDF. The -:ref:`CONFIG_SUPPORT_STATIC_ALLOCATION` option must be enabled in `menuconfig` +:ref:`CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION` option must be enabled in `menuconfig` in order for static allocation functions to be available. Once enabled, the following functions can be called... @@ -494,7 +494,7 @@ occurences of ``CONFIG_FREERTOS_UNICORE`` in the ESP-IDF components. number of Thread Local Storage Pointers each task will have in ESP-IDF FreeRTOS. -:ref:`CONFIG_SUPPORT_STATIC_ALLOCATION` will enable the backported +:ref:`CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION` will enable the backported functionality of :cpp:func:`xTaskCreateStaticPinnedToCore` in ESP-IDF FreeRTOS :ref:`CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION` will trigger a halt in diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index d5b44b6a44..d9582a84c1 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -302,10 +302,10 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_FREERTOS_LEGACY_HOOKS= CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 -CONFIG_SUPPORT_STATIC_ALLOCATION= -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION= +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_FREERTOS_USE_TRACE_FACILITY= CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS= diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index 4efe0e2644..371c08bb03 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -23,7 +23,7 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=y CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7 CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y CONFIG_COMPILER_STACK_CHECK=y -CONFIG_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y CONFIG_ESP_TIMER_PROFILING=y CONFIG_ADC2_DISABLE_DAC=n CONFIG_COMPILER_WARN_WRITE_STRINGS=y