forked from espressif/esp-idf
feat(freertos): Add application task tag support
This commit enables support for application task tag. - Added CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG option - Added basic unit test
This commit is contained in:
@ -324,6 +324,13 @@ menu "FreeRTOS"
|
|||||||
esp_pm_dump_locks, if the proportion of rejected sleeps is too high, please increase
|
esp_pm_dump_locks, if the proportion of rejected sleeps is too high, please increase
|
||||||
this value to improve scheduling efficiency
|
this value to improve scheduling efficiency
|
||||||
|
|
||||||
|
config FREERTOS_USE_APPLICATION_TASK_TAG
|
||||||
|
bool "configUSE_APPLICATION_TASK_TAG"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enables task tagging functionality and its associated API (see configUSE_APPLICATION_TASK_TAG
|
||||||
|
documentation for more details).
|
||||||
|
|
||||||
endmenu # Kernel
|
endmenu # Kernel
|
||||||
|
|
||||||
menu "Port"
|
menu "Port"
|
||||||
|
@ -255,6 +255,10 @@
|
|||||||
#endif /* CONFIG_FREERTOS_SMP */
|
#endif /* CONFIG_FREERTOS_SMP */
|
||||||
#endif /* def __ASSEMBLER__ */
|
#endif /* def __ASSEMBLER__ */
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG
|
||||||
|
#define configUSE_APPLICATION_TASK_TAG 1
|
||||||
|
#endif // CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG
|
||||||
|
|
||||||
/* -------------- List Data Integrity Checks --------------- */
|
/* -------------- List Data Integrity Checks --------------- */
|
||||||
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES
|
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES
|
||||||
|
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
#include "freertos/FreeRTOS.h"
|
||||||
|
#include "freertos/task.h"
|
||||||
|
#include "unity.h"
|
||||||
|
#include "test_utils.h"
|
||||||
|
|
||||||
|
#if CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG
|
||||||
|
|
||||||
|
static BaseType_t tag_cb(void *arg)
|
||||||
|
{
|
||||||
|
BaseType_t *tag_cb_called = (BaseType_t *)arg;
|
||||||
|
*tag_cb_called = pdTRUE;
|
||||||
|
return pdTRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Test application task tag", "[freertos]")
|
||||||
|
{
|
||||||
|
BaseType_t tag_cb_called = pdFALSE;
|
||||||
|
|
||||||
|
// Set the app task tag for current task
|
||||||
|
vTaskSetApplicationTaskTag(NULL, tag_cb);
|
||||||
|
// Check app task tag is correct
|
||||||
|
TEST_ASSERT_EQUAL(tag_cb, xTaskGetApplicationTaskTag(NULL));
|
||||||
|
// Test the app task tag by calling it
|
||||||
|
TEST_ASSERT_EQUAL(pdTRUE, xTaskCallApplicationTaskHook(NULL, (void *)&tag_cb_called));
|
||||||
|
TEST_ASSERT_EQUAL(pdTRUE, tag_cb_called);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG
|
@ -21,3 +21,4 @@ CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES=y
|
|||||||
CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1=y
|
CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1=y
|
||||||
CONFIG_FREERTOS_USE_TICK_HOOK=y
|
CONFIG_FREERTOS_USE_TICK_HOOK=y
|
||||||
CONFIG_FREERTOS_USE_IDLE_HOOK=y
|
CONFIG_FREERTOS_USE_IDLE_HOOK=y
|
||||||
|
CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG=y
|
||||||
|
Reference in New Issue
Block a user