diff --git a/common_components/linux_compat/freertos/freertos_linux.c b/common_components/linux_compat/freertos/freertos_linux.c index 37b66e02a3..9055f7e55b 100644 --- a/common_components/linux_compat/freertos/freertos_linux.c +++ b/common_components/linux_compat/freertos/freertos_linux.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -212,6 +212,20 @@ void *pthread_task(void *params) return NULL; } +TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode, + const char *const pcName, + const uint32_t ulStackDepth, + void *const pvParameters, + UBaseType_t uxPriority, + StackType_t *const puxStackBuffer, + StaticTask_t *const pxTaskBuffer, + const BaseType_t xCoreID ) +{ + static TaskHandle_t pvCreatedTask; + xTaskCreate(pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, &pvCreatedTask); + return pvCreatedTask; +} + BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth, diff --git a/common_components/linux_compat/freertos/include/freertos/task.h b/common_components/linux_compat/freertos/include/freertos/task.h index 235f467613..307245d280 100644 --- a/common_components/linux_compat/freertos/include/freertos/task.h +++ b/common_components/linux_compat/freertos/include/freertos/task.h @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include "freertos/FreeRTOS.h" +#include "esp_heap_caps.h" #ifdef __cplusplus extern "C" { @@ -15,6 +16,9 @@ extern "C" { #define TaskHandle_t TaskHandle_t #define vSemaphoreDelete( xSemaphore ) vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) ) +typedef void *StackType_t; +typedef void *StaticTask_t; + void vTaskDelay( const TickType_t xTicksToDelay ); void xTaskNotifyGive(TaskHandle_t task); @@ -25,6 +29,15 @@ TaskHandle_t xTaskGetCurrentTaskHandle(void); BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time ); +TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode, + const char *const pcName, + const uint32_t ulStackDepth, + void *const pvParameters, + UBaseType_t uxPriority, + StackType_t *const puxStackBuffer, + StaticTask_t *const pxTaskBuffer, + const BaseType_t xCoreID ); + BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth, @@ -81,6 +94,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait ); +void *heap_caps_malloc( size_t size, uint32_t caps); +void heap_caps_free( void *ptr); + #ifdef __cplusplus } #endif //__cplusplus