freertos: Remove legacy data types

This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.
This commit is contained in:
Darian Leung
2022-02-08 17:39:38 +08:00
parent 5810ed1d04
commit 57fd78f5ba
169 changed files with 635 additions and 706 deletions

View File

@@ -140,7 +140,7 @@ static void vPortTaskWrapper(TaskFunction_t pxCode, void *pvParameters)
{
pxCode(pvParameters);
//FreeRTOS tasks should not return. Log the task name and abort.
char *pcTaskName = pcTaskGetTaskName(NULL);
char *pcTaskName = pcTaskGetName(NULL);
ESP_LOGE("FreeRTOS", "FreeRTOS Task \"%s\" should not return, Aborting now!", pcTaskName);
abort();
}

View File

@@ -219,6 +219,13 @@ menu "FreeRTOS"
For most uses, the default of 16 is OK.
config FREERTOS_ENABLE_BACKWARD_COMPATIBILITY
bool "Support legacy FreeRTOS API"
default n
help
This option enables the configENABLE_BACKWARD_COMPATIBILITY option, thus allowing the usage
of legacy function names and types present in versions prior to FreeRTOS v8.0.0.
config FREERTOS_SUPPORT_STATIC_ALLOCATION
# Always enabled.
# Kconfig option preserved for compatibility with code

View File

@@ -191,6 +191,12 @@
#define configUSE_NEWLIB_REENTRANT 1
#endif
#if CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY
#define configENABLE_BACKWARD_COMPATIBILITY 1
#else
#define configENABLE_BACKWARD_COMPATIBILITY 0
#endif
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configSUPPORT_STATIC_ALLOCATION 1

View File

@@ -1,3 +1,8 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
Combined unit tests & benchmarking for spinlock "portMUX" functionality
*/
@@ -73,7 +78,7 @@ TEST_CASE("portMUX recursive locks (no contention)", "[freertos]")
static volatile int shared_value;
static portMUX_TYPE shared_mux;
static xSemaphoreHandle done_sem;
static SemaphoreHandle_t done_sem;
static void task_shared_value_increment(void *ignore)
{