refactor(freertos): Updated FreeRTOS component files to astyle format

This commit updates the FreeRTOS component source files (excluding
upstream source files) to the astyle coding format.
This commit is contained in:
Sudeep Mohanty
2024-01-26 15:07:54 +01:00
committed by BOT
parent b2b84f9b5c
commit 061da98124
34 changed files with 384 additions and 402 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -30,21 +30,21 @@
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 0 )
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
#endif
#include "esp_heap_caps.h"
#if !CONFIG_IDF_TARGET_LINUX
/* Memory util functions are not implemented in the Linux simulator */
#include "esp_memory_utils.h"
/* Memory util functions are not implemented in the Linux simulator */
#include "esp_memory_utils.h"
#endif /* CONFIG_IDF_TARGET_LINUX */
#define portFREERTOS_HEAP_CAPS ( MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT )
/*-----------------------------------------------------------*/
void * pvPortMalloc( size_t xWantedSize )
void * pvPortMalloc(size_t xWantedSize)
{
void * pvReturn = NULL;
@@ -52,57 +52,57 @@ void * pvPortMalloc( size_t xWantedSize )
* users need to allocate FreeRTOS objects into external RAM, they should
* use the "static" equivalents of FreeRTOS API to create FreeRTOS objects
* (e.g., queues). */
pvReturn = heap_caps_malloc( xWantedSize, portFREERTOS_HEAP_CAPS );
pvReturn = heap_caps_malloc(xWantedSize, portFREERTOS_HEAP_CAPS);
return pvReturn;
}
/*-----------------------------------------------------------*/
void vPortFree( void * pv )
void vPortFree(void * pv)
{
heap_caps_free( pv );
heap_caps_free(pv);
}
/*-----------------------------------------------------------*/
size_t xPortGetFreeHeapSize( void )
size_t xPortGetFreeHeapSize(void)
{
return heap_caps_get_free_size( portFREERTOS_HEAP_CAPS );
return heap_caps_get_free_size(portFREERTOS_HEAP_CAPS);
}
/*-----------------------------------------------------------*/
size_t xPortGetMinimumEverFreeHeapSize( void )
size_t xPortGetMinimumEverFreeHeapSize(void)
{
return heap_caps_get_minimum_free_size( portFREERTOS_HEAP_CAPS );
return heap_caps_get_minimum_free_size(portFREERTOS_HEAP_CAPS);
}
/*-----------------------------------------------------------*/
bool xPortCheckValidListMem( const void * ptr )
bool xPortCheckValidListMem(const void * ptr)
{
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
return esp_ptr_internal( ptr ) && esp_ptr_byte_accessible( ptr );
#endif /* CONFIG_IDF_TARGET_LINUX */
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
return esp_ptr_internal(ptr) && esp_ptr_byte_accessible(ptr);
#endif /* CONFIG_IDF_TARGET_LINUX */
}
bool xPortCheckValidTCBMem( const void * ptr )
bool xPortCheckValidTCBMem(const void * ptr)
{
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
return esp_ptr_internal( ptr ) && esp_ptr_byte_accessible( ptr );
#endif /* CONFIG_IDF_TARGET_LINUX */
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
return esp_ptr_internal(ptr) && esp_ptr_byte_accessible(ptr);
#endif /* CONFIG_IDF_TARGET_LINUX */
}
bool xPortcheckValidStackMem( const void * ptr )
bool xPortcheckValidStackMem(const void * ptr)
{
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
#ifdef CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
return esp_ptr_byte_accessible( ptr );
#else
return esp_ptr_internal( ptr ) && esp_ptr_byte_accessible( ptr );
#endif
#endif /* CONFIG_IDF_TARGET_LINUX */
#if CONFIG_IDF_TARGET_LINUX
return true;
#else /* CONFIG_IDF_TARGET_LINUX */
#ifdef CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
return esp_ptr_byte_accessible(ptr);
#else
return esp_ptr_internal(ptr) && esp_ptr_byte_accessible(ptr);
#endif
#endif /* CONFIG_IDF_TARGET_LINUX */
}