refactor(freertos): Uncrustify and format IDF addition headers

- Uncrustified IDF addition related header/source files
- Reorganized functions into groups
- linker_common.lf updated to adhere to new function organization
This commit is contained in:
Darian Leung
2023-08-29 14:27:09 +08:00
parent a67e8c1972
commit 0a15f28d17
6 changed files with 813 additions and 571 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -12,23 +12,26 @@
* This file maintains these legacy APIs until the next ESP-IDF major release. * This file maintains these legacy APIs until the next ESP-IDF major release.
* *
* Todo: Clean up for ESP-IDF v6.0 (IDF-8144) * Todo: Clean up for ESP-IDF v6.0 (IDF-8144)
*/ */
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "queue.h" #include "queue.h"
#include "semphr.h" #include "semphr.h"
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xPeek ) BaseType_t xQueueGenericReceive( QueueHandle_t xQueue,
void * const pvBuffer,
TickType_t xTicksToWait,
const BaseType_t xPeek )
{ {
if ( xPeek == pdTRUE ) if( xPeek == pdTRUE )
{ {
return xQueuePeek( xQueue, pvBuffer, xTicksToWait ); return xQueuePeek( xQueue, pvBuffer, xTicksToWait );
} }
if ( pvBuffer == NULL ) if( pvBuffer == NULL )
{ {
return xQueueSemaphoreTake( xQueue, xTicksToWait ); return xQueueSemaphoreTake( xQueue, xTicksToWait );
} }
return xQueueReceive( xQueue, pvBuffer, xTicksToWait ); return xQueueReceive( xQueue, pvBuffer, xTicksToWait );
} }

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
/*
* This file contains the implementation for some the functions in
* idf_additions.h
*/
#include "sdkconfig.h" #include "sdkconfig.h"
#include <stdint.h> #include <stdint.h>
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
@@ -17,19 +22,12 @@
#include "freertos/idf_additions.h" #include "freertos/idf_additions.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
/* /* -------------------------------------------- Creation With Memory Caps ------------------------------------------- */
* This file contains the implementation for some the functions in
* idf_additions.h
*/
/* -----------------------------------------------------------------------------
* Creation With Memory Caps
* -------------------------------------------------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/* ---------------------------------- Tasks --------------------------------- */ /* ---------------------------------- Tasks --------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
BaseType_t xTaskCreatePinnedToCoreWithCaps( TaskFunction_t pvTaskCode, BaseType_t xTaskCreatePinnedToCoreWithCaps( TaskFunction_t pvTaskCode,
const char * const pcName, const char * const pcName,
const configSTACK_DEPTH_TYPE usStackDepth, const configSTACK_DEPTH_TYPE usStackDepth,
@@ -78,6 +76,11 @@ err:
return pdFAIL; return pdFAIL;
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
void vTaskDeleteWithCaps( TaskHandle_t xTaskToDelete ) void vTaskDeleteWithCaps( TaskHandle_t xTaskToDelete )
{ {
BaseType_t xResult; BaseType_t xResult;
@@ -95,8 +98,13 @@ err:
vPortFree( pxTaskBuffer ); vPortFree( pxTaskBuffer );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
/* ---------------------------------- Queue --------------------------------- */ /* ---------------------------------- Queue --------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
QueueHandle_t xQueueCreateWithCaps( UBaseType_t uxQueueLength, QueueHandle_t xQueueCreateWithCaps( UBaseType_t uxQueueLength,
UBaseType_t uxItemSize, UBaseType_t uxItemSize,
UBaseType_t uxMemoryCaps ) UBaseType_t uxMemoryCaps )
@@ -138,6 +146,11 @@ err:
return NULL; return NULL;
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
void vQueueDeleteWithCaps( QueueHandle_t xQueue ) void vQueueDeleteWithCaps( QueueHandle_t xQueue )
{ {
BaseType_t xResult; BaseType_t xResult;
@@ -156,8 +169,13 @@ err:
heap_caps_free( pucQueueStorageBuffer ); heap_caps_free( pucQueueStorageBuffer );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
/* -------------------------------- Semaphore ------------------------------- */ /* -------------------------------- Semaphore ------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
SemaphoreHandle_t xSemaphoreCreateGenericWithCaps( UBaseType_t uxMaxCount, SemaphoreHandle_t xSemaphoreCreateGenericWithCaps( UBaseType_t uxMaxCount,
UBaseType_t uxInitialCount, UBaseType_t uxInitialCount,
const uint8_t ucQueueType, const uint8_t ucQueueType,
@@ -200,6 +218,11 @@ err:
return xSemaphore; return xSemaphore;
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
void vSemaphoreDeleteWithCaps( SemaphoreHandle_t xSemaphore ) void vSemaphoreDeleteWithCaps( SemaphoreHandle_t xSemaphore )
{ {
BaseType_t xResult; BaseType_t xResult;
@@ -217,8 +240,13 @@ err:
heap_caps_free( pxSemaphoreBuffer ); heap_caps_free( pxSemaphoreBuffer );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
/* ------------------------- Stream & Message Buffers ----------------------- */ /* ------------------------- Stream & Message Buffers ----------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
StreamBufferHandle_t xStreamBufferGenericCreateWithCaps( size_t xBufferSizeBytes, StreamBufferHandle_t xStreamBufferGenericCreateWithCaps( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes, size_t xTriggerLevelBytes,
BaseType_t xIsMessageBuffer, BaseType_t xIsMessageBuffer,
@@ -261,6 +289,11 @@ err:
return NULL; return NULL;
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer, void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer,
BaseType_t xIsMessageBuffer ) BaseType_t xIsMessageBuffer )
{ {
@@ -296,8 +329,13 @@ err:
heap_caps_free( pucStreamBufferStorageArea ); heap_caps_free( pucStreamBufferStorageArea );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
/* ------------------------------ Event Groups ------------------------------ */ /* ------------------------------ Event Groups ------------------------------ */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreateWithCaps( UBaseType_t uxMemoryCaps ) EventGroupHandle_t xEventGroupCreateWithCaps( UBaseType_t uxMemoryCaps )
{ {
EventGroupHandle_t xEventGroup; EventGroupHandle_t xEventGroup;
@@ -322,6 +360,11 @@ err:
return xEventGroup; return xEventGroup;
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
void vEventGroupDeleteWithCaps( EventGroupHandle_t xEventGroup ) void vEventGroupDeleteWithCaps( EventGroupHandle_t xEventGroup )
{ {
BaseType_t xResult; BaseType_t xResult;
@@ -340,3 +383,4 @@ err:
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/*----------------------------------------------------------*/

View File

@@ -8,25 +8,29 @@
/* /*
* This file is like "idf_additions.h" but for private API (i.e., only meant to * This file is like "idf_additions.h" but for private API (i.e., only meant to
* be called by other internally by other * be called internally by other ESP-IDF components.
* ESP-IDF components.
*/ */
#include "sdkconfig.h" #include "sdkconfig.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
/* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* *INDENT-ON* */
/* ----------------------------------------------------------------------------- /*------------------------------------------------------------------------------
* Priority Raise/Restore * TASK UTILITIES (PRIVATE)
* - Special functions to forcefully raise and restore a task's priority *----------------------------------------------------------------------------*/
* - Used by cache_utils.c when disabling/enabling the cache
* -------------------------------------------------------------------------- */
#if ( INCLUDE_vTaskPrioritySet == 1 ) #if ( INCLUDE_vTaskPrioritySet == 1 )
/**
* @brief Structure to save a task's previous priority
*
* This structure is meant to be used with prvTaskPriorityRaise() and
* prvTaskPriorityRestore().
*/
typedef struct typedef struct
{ {
UBaseType_t uxPriority; UBaseType_t uxPriority;
@@ -35,13 +39,17 @@
#endif #endif
} prvTaskSavedPriority_t; } prvTaskSavedPriority_t;
#endif /* INCLUDE_vTaskPrioritySet == 1 */
#if ( INCLUDE_vTaskPrioritySet == 1 )
/** /**
* INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be
* available. See the configuration section for more information. * available. See the configuration section for more information.
* *
* Saves the current priority and current base priority of a task, then * Saves the current priority and current base priority of a task, then raises
* raises the task's current and base priority to uxNewPriority if * the task's current and base priority to uxNewPriority if uxNewPriority is of
* uxNewPriority is of a higher priority. * a higher priority.
* *
* Once a task's priority has been raised with this function, the priority * Once a task's priority has been raised with this function, the priority
* can be restored by calling prvTaskPriorityRestore() * can be restored by calling prvTaskPriorityRestore()
@@ -53,8 +61,8 @@
* forced immediately to a higher priority. * forced immediately to a higher priority.
* *
* For configUSE_MUTEXES == 0: A context switch will occur before the * For configUSE_MUTEXES == 0: A context switch will occur before the
* function returns if the priority being set is higher than the currently * function returns if the priority being set is higher than the priority of the
* executing task. * currently executing task.
* *
* @note This functions is private and should only be called internally * @note This functions is private and should only be called internally
* within various IDF components. Users should never call this function from * within various IDF components. Users should never call this function from
@@ -71,17 +79,20 @@
void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority, void prvTaskPriorityRaise( prvTaskSavedPriority_t * pxSavedPriority,
UBaseType_t uxNewPriority ); UBaseType_t uxNewPriority );
#endif /* INCLUDE_vTaskPrioritySet == 1 */
#if ( INCLUDE_vTaskPrioritySet == 1 )
/** /**
* INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be
* available. * available. See the configuration section for more information.
* See the configuration section for more information.
* *
* Restore a task's priority that was previously raised by * Restore a task's priority that was previously raised by
* prvTaskPriorityRaise(). * prvTaskPriorityRaise().
* *
* For configUSE_MUTEXES == 0: A context switch will occur before the function * For configUSE_MUTEXES == 0: A context switch will occur before the function
* returns if the priority * returns if the priority being set is higher than the priority of the currently
* being set is higher than the currently executing task. * executing task.
* *
* @note This functions is private and should only be called internally within * @note This functions is private and should only be called internally within
* various IDF components. Users should never call this function from their * various IDF components. Users should never call this function from their
@@ -92,8 +103,10 @@
*/ */
void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority ); void prvTaskPriorityRestore( prvTaskSavedPriority_t * pxSavedPriority );
#endif // ( INCLUDE_vTaskPrioritySet == 1) #endif /* INCLUDE_vTaskPrioritySet == 1 */
/* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* *INDENT-ON* */

View File

@@ -25,20 +25,20 @@
#include "freertos/event_groups.h" #include "freertos/event_groups.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
/* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* *INDENT-ON* */
/* ----------------------------------------------------------------------------- /* -------------------------------------------------- Task Creation ---------------------------------------------------
* SMP related API additions to FreeRTOS * Task Creation APIs added by ESP-IDF
* *
* Todo: Move IDF FreeRTOS SMP related additions to this header as well (see * Todo: Move IDF FreeRTOS SMP related additions to this header as well (see IDF-7201)
* IDF-7201) * Todo: Add these SMP related additions to docs once they are combined with IDF FreeRTOS.
* Todo: Add these SMP related additions to docs once they are combined with * ------------------------------------------------------------------------------------------------------------------ */
* IDF FreeRTOS.
* -------------------------------------------------------------------------- */
#if CONFIG_FREERTOS_SMP #if ( CONFIG_FREERTOS_SMP && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
/** /**
* @brief Create a new task that is pinned to a particular core * @brief Create a new task that is pinned to a particular core
@@ -69,6 +69,9 @@
TaskHandle_t * const pxCreatedTask, TaskHandle_t * const pxCreatedTask,
const BaseType_t xCoreID ); const BaseType_t xCoreID );
#endif /* ( CONFIG_FREERTOS_SMP && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
#if ( CONFIG_FREERTOS_SMP && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
/** /**
* @brief Create a new static task that is pinned to a particular core * @brief Create a new static task that is pinned to a particular core
@@ -89,16 +92,22 @@
* the task has no core affinity * the task has no core affinity
* @return The task handle if the task was created, NULL otherwise. * @return The task handle if the task was created, NULL otherwise.
*/ */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode,
TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode, const char * const pcName,
const char * const pcName, const uint32_t ulStackDepth,
const uint32_t ulStackDepth, void * const pvParameters,
void * const pvParameters, UBaseType_t uxPriority,
UBaseType_t uxPriority, StackType_t * const puxStackBuffer,
StackType_t * const puxStackBuffer, StaticTask_t * const pxTaskBuffer,
StaticTask_t * const pxTaskBuffer, const BaseType_t xCoreID );
const BaseType_t xCoreID );
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* ( CONFIG_FREERTOS_SMP && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) */
/* ------------------------------------------------- Task Utilities ----------------------------------------------------
* Todo: Move IDF FreeRTOS SMP related additions to this header as well (see IDF-7201)
* ------------------------------------------------------------------------------------------------------------------ */
#if CONFIG_FREERTOS_SMP
/** /**
* @brief Get the handle of the task running on a certain core * @brief Get the handle of the task running on a certain core
@@ -115,6 +124,10 @@
*/ */
TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID ); TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID );
#endif /* CONFIG_FREERTOS_SMP */
#if CONFIG_FREERTOS_SMP
/** /**
* @brief Get the handle of idle task for the given CPU. * @brief Get the handle of idle task for the given CPU.
* *
@@ -126,6 +139,10 @@
*/ */
TaskHandle_t xTaskGetIdleTaskHandleForCPU( BaseType_t xCoreID ); TaskHandle_t xTaskGetIdleTaskHandleForCPU( BaseType_t xCoreID );
#endif /* CONFIG_FREERTOS_SMP */
#if CONFIG_FREERTOS_SMP
/** /**
* @brief Get the current core affinity of a particular task * @brief Get the current core affinity of a particular task
* *
@@ -141,26 +158,27 @@
*/ */
BaseType_t xTaskGetAffinity( TaskHandle_t xTask ); BaseType_t xTaskGetAffinity( TaskHandle_t xTask );
#endif // CONFIG_FREERTOS_SMP #endif /* CONFIG_FREERTOS_SMP */
/* ----------------------------------------------------------------------------- /* --------------------------------------------- TLSP Deletion Callbacks -----------------------------------------------
* TLSP Deletion Callback related API additions * TLSP Deletion Callback API Additions
* *
* Todo: Move IDF FreeRTOS TLSP Deletion Callback related additions to this * Todo: Move IDF FreeRTOS TLSP Deletion Callback related additions to this header as well (see IDF-7201)
* header as well (see IDF-7201) * Todo: Add these SMP related additions to docs once they are combined with IDF FreeRTOS.
* Todo: Add these SMP related additions to docs once they are combined with * ------------------------------------------------------------------------------------------------------------------ */
* IDF FreeRTOS.
* -------------------------------------------------------------------------- */
#if CONFIG_FREERTOS_SMP #if ( CONFIG_FREERTOS_SMP && CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS )
#if ( CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS )
/** /**
* Prototype of local storage pointer deletion callback. * Prototype of local storage pointer deletion callback.
*/ */
typedef void (* TlsDeleteCallbackFunction_t)( int, typedef void (* TlsDeleteCallbackFunction_t)( int,
void * ); void * );
#endif /* ( CONFIG_FREERTOS_SMP && CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS ) */
#if ( CONFIG_FREERTOS_SMP && CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS )
/** /**
* Set local storage pointer and deletion callback. * Set local storage pointer and deletion callback.
@@ -184,25 +202,22 @@
* @param pvDelCallback Function to call to dispose of the local storage * @param pvDelCallback Function to call to dispose of the local storage
* pointer when the task is deleted. * pointer when the task is deleted.
*/ */
void vTaskSetThreadLocalStoragePointerAndDelCallback( TaskHandle_t xTaskToSet, void vTaskSetThreadLocalStoragePointerAndDelCallback( TaskHandle_t xTaskToSet,
BaseType_t xIndex, BaseType_t xIndex,
void * pvValue, void * pvValue,
TlsDeleteCallbackFunction_t pvDelCallback ); TlsDeleteCallbackFunction_t pvDelCallback );
#endif // CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS
#endif // CONFIG_FREERTOS_SMP #endif /* ( CONFIG_FREERTOS_SMP && CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS ) */
/* ----------------------------------------------------------------------------- /* -------------------------------------------- Creation With Memory Caps ----------------------------------------------
* Creation With Memory Caps * Helper functions to create various FreeRTOS objects (e.g., queues, semaphores) with specific memory capabilities
* * (e.g., MALLOC_CAP_INTERNAL).
* Helper functions to create various FreeRTOS objects (e.g., queues, * ------------------------------------------------------------------------------------------------------------------ */
* semaphores) with specific memory capabilities (e.g., MALLOC_CAP_INTERNAL).
* -------------------------------------------------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/* ---------------------------------- Tasks --------------------------------- */ /* ---------------------------------- Tasks --------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a pinned task where its stack has specific memory capabilities * @brief Creates a pinned task where its stack has specific memory capabilities
* *
@@ -238,6 +253,10 @@
const BaseType_t xCoreID, const BaseType_t xCoreID,
UBaseType_t uxMemoryCaps ); UBaseType_t uxMemoryCaps );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a task where its stack has specific memory capabilities * @brief Creates a task where its stack has specific memory capabilities
* *
@@ -275,6 +294,10 @@
return xTaskCreatePinnedToCoreWithCaps( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY, uxMemoryCaps ); return xTaskCreatePinnedToCoreWithCaps( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes a task previously created using xTaskCreateWithCaps() or * @brief Deletes a task previously created using xTaskCreateWithCaps() or
* xTaskCreatePinnedToCoreWithCaps() * xTaskCreatePinnedToCoreWithCaps()
@@ -283,8 +306,12 @@
*/ */
void vTaskDeleteWithCaps( TaskHandle_t xTaskToDelete ); void vTaskDeleteWithCaps( TaskHandle_t xTaskToDelete );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
/* ---------------------------------- Queue --------------------------------- */ /* ---------------------------------- Queue --------------------------------- */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a queue with specific memory capabilities * @brief Creates a queue with specific memory capabilities
* *
@@ -304,6 +331,10 @@
UBaseType_t uxItemSize, UBaseType_t uxItemSize,
UBaseType_t uxMemoryCaps ); UBaseType_t uxMemoryCaps );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes a queue previously created using xQueueCreateWithCaps() * @brief Deletes a queue previously created using xQueueCreateWithCaps()
* *
@@ -311,15 +342,19 @@
*/ */
void vQueueDeleteWithCaps( QueueHandle_t xQueue ); void vQueueDeleteWithCaps( QueueHandle_t xQueue );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
/* -------------------------------- Semaphore ------------------------------- */ /* -------------------------------- Semaphore ------------------------------- */
/** @cond */ /* Doxygen command to hide this from docs */ /** @cond */ /* Doxygen command to hide this from docs */
SemaphoreHandle_t xSemaphoreCreateGenericWithCaps( UBaseType_t uxMaxCount, SemaphoreHandle_t xSemaphoreCreateGenericWithCaps( UBaseType_t uxMaxCount,
UBaseType_t uxInitialCount, UBaseType_t uxInitialCount,
const uint8_t ucQueueType, const uint8_t ucQueueType,
UBaseType_t uxMemoryCaps ); UBaseType_t uxMemoryCaps );
/** @endcond */ /** @endcond */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a binary semaphore with specific memory capabilities * @brief Creates a binary semaphore with specific memory capabilities
* *
@@ -338,6 +373,10 @@
return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_BINARY_SEMAPHORE, uxMemoryCaps ); return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_BINARY_SEMAPHORE, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a counting semaphore with specific memory capabilities * @brief Creates a counting semaphore with specific memory capabilities
* *
@@ -361,6 +400,10 @@
return xSemaphoreCreateGenericWithCaps( uxMaxCount, uxInitialCount, queueQUEUE_TYPE_COUNTING_SEMAPHORE, uxMemoryCaps ); return xSemaphoreCreateGenericWithCaps( uxMaxCount, uxInitialCount, queueQUEUE_TYPE_COUNTING_SEMAPHORE, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a mutex semaphore with specific memory capabilities * @brief Creates a mutex semaphore with specific memory capabilities
* *
@@ -379,6 +422,10 @@
return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_MUTEX, uxMemoryCaps ); return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_MUTEX, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a recursive mutex with specific memory capabilities * @brief Creates a recursive mutex with specific memory capabilities
* *
@@ -397,6 +444,10 @@
return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_RECURSIVE_MUTEX, uxMemoryCaps ); return xSemaphoreCreateGenericWithCaps( 0, 0, queueQUEUE_TYPE_RECURSIVE_MUTEX, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes a semaphore previously created using one of the * @brief Deletes a semaphore previously created using one of the
* xSemaphoreCreate...WithCaps() functions * xSemaphoreCreate...WithCaps() functions
@@ -405,18 +456,22 @@
*/ */
void vSemaphoreDeleteWithCaps( SemaphoreHandle_t xSemaphore ); void vSemaphoreDeleteWithCaps( SemaphoreHandle_t xSemaphore );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
/* ------------------------ Stream & Message Buffers ------------------------ */ /* ------------------------ Stream & Message Buffers ------------------------ */
/** @cond */ /* Doxygen command to hide this from docs */ /** @cond */ /* Doxygen command to hide this from docs */
StreamBufferHandle_t xStreamBufferGenericCreateWithCaps( size_t xBufferSizeBytes, StreamBufferHandle_t xStreamBufferGenericCreateWithCaps( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes, size_t xTriggerLevelBytes,
BaseType_t xIsMessageBuffer, BaseType_t xIsMessageBuffer,
UBaseType_t uxMemoryCaps ); UBaseType_t uxMemoryCaps );
void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer, void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer,
BaseType_t xIsMessageBuffer ); BaseType_t xIsMessageBuffer );
/** @endcond */ /** @endcond */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a stream buffer with specific memory capabilities * @brief Creates a stream buffer with specific memory capabilities
* *
@@ -441,6 +496,10 @@
return xStreamBufferGenericCreateWithCaps( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, uxMemoryCaps ); return xStreamBufferGenericCreateWithCaps( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes a stream buffer previously created using * @brief Deletes a stream buffer previously created using
* xStreamBufferCreateWithCaps() * xStreamBufferCreateWithCaps()
@@ -452,6 +511,10 @@
vStreamBufferGenericDeleteWithCaps( xStreamBuffer, pdFALSE ); vStreamBufferGenericDeleteWithCaps( xStreamBuffer, pdFALSE );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates a message buffer with specific memory capabilities * @brief Creates a message buffer with specific memory capabilities
* *
@@ -473,6 +536,10 @@
return ( MessageBufferHandle_t ) xStreamBufferGenericCreateWithCaps( xBufferSizeBytes, ( size_t ) 0, pdTRUE, uxMemoryCaps ); return ( MessageBufferHandle_t ) xStreamBufferGenericCreateWithCaps( xBufferSizeBytes, ( size_t ) 0, pdTRUE, uxMemoryCaps );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes a stream buffer previously created using * @brief Deletes a stream buffer previously created using
* xMessageBufferCreateWithCaps() * xMessageBufferCreateWithCaps()
@@ -484,8 +551,12 @@
vStreamBufferGenericDeleteWithCaps( ( StreamBufferHandle_t ) xMessageBuffer, pdTRUE ); vStreamBufferGenericDeleteWithCaps( ( StreamBufferHandle_t ) xMessageBuffer, pdTRUE );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
/* ------------------------------ Event Groups ------------------------------ */ /* ------------------------------ Event Groups ------------------------------ */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Creates an event group with specific memory capabilities * @brief Creates an event group with specific memory capabilities
* *
@@ -501,6 +572,10 @@
*/ */
EventGroupHandle_t xEventGroupCreateWithCaps( UBaseType_t uxMemoryCaps ); EventGroupHandle_t xEventGroupCreateWithCaps( UBaseType_t uxMemoryCaps );
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* @brief Deletes an event group previously created using * @brief Deletes an event group previously created using
* xEventGroupCreateWithCaps() * xEventGroupCreateWithCaps()
@@ -509,8 +584,10 @@
*/ */
void vEventGroupDeleteWithCaps( EventGroupHandle_t xEventGroup ); void vEventGroupDeleteWithCaps( EventGroupHandle_t xEventGroup );
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
/* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* *INDENT-ON* */

View File

@@ -6,33 +6,35 @@ archive: libfreertos.a
entries: entries:
# ------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------
# esp_additions/private_include/freertos_tasks_c_additions.h # esp_additions/private_include/freertos_tasks_c_additions.h
# Placement Rules (FreeRTOS API Additions):
# - Default: Place all functions in internal RAM.
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH: Place functions in flash if they are never called from an ISR
# context (directly or indirectly).
# Placement Rules (Task Snapshot): # Placement Rules (Task Snapshot):
# - Default: Place all functions in internal RAM. # - Default: Place all functions in internal RAM.
# - CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH: Place functions in flash # - CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH: Place functions in flash
# - vTaskGetSnapshot is omitted on purpose as it is used to by the Task Watchdog (TWDT) interrupt handler, we want # - vTaskGetSnapshot is omitted on purpose as it is used to by the Task Watchdog (TWDT) interrupt handler, we want
# to always keep it in IRAM # to always keep it in IRAM
# Placement Rules (FreeRTOS API Additions):
# - Default: Place all functions in internal RAM.
# - CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH: Place functions in flash if they are never called from an ISR
# context (directly or indirectly).
# ------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
# Task Creation
if FREERTOS_SMP = y:
tasks:xTaskCreatePinnedToCore (default)
tasks:xTaskCreateStaticPinnedToCore (default)
# Task Utilities
tasks:xTaskGetCurrentTaskHandleForCPU (default)
tasks:xTaskGetIdleTaskHandleForCPU (default)
tasks:xTaskGetAffinity (default)
tasks:prvTaskPriorityRaise (default)
tasks:prvTaskPriorityRestore (default)
# TLSP Deletion Callbacks
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
tasks:vTaskSetThreadLocalStoragePointerAndDelCallback (default)
# Task Snapshot # Task Snapshot
if FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH = y: if FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH = y:
tasks:pxGetNextTaskList (default) tasks:pxGetNextTaskList (default)
tasks:pxTaskGetNext (default) tasks:pxTaskGetNext (default)
tasks:uxTaskGetSnapshotAll (default) tasks:uxTaskGetSnapshotAll (default)
# FreeRTOS API Additions
if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y:
if FREERTOS_SMP = y:
tasks:xTaskCreatePinnedToCore (default)
tasks:xTaskCreateStaticPinnedToCore (default)
tasks:xTaskGetCurrentTaskHandleForCPU (default)
tasks:xTaskGetIdleTaskHandleForCPU (default)
tasks:xTaskGetAffinity (default)
if FREERTOS_TLSP_DELETION_CALLBACKS = y:
tasks:vTaskSetThreadLocalStoragePointerAndDelCallback (default)
tasks:prvTaskPriorityRaise (default)
tasks:prvTaskPriorityRestore (default)
# ------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------
# idf_additions.c # idf_additions.c