stm32h743_player/User/ports/heap/heap_freertos.c
2024-03-03 22:46:44 +08:00

37 lines
790 B
C

/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "heap.h"
void *pvPortMalloc( size_t xWantedSize )
{
void *pvReturn;
pvReturn = malloc_dtcm( xWantedSize );
traceMALLOC( pvReturn, xWantedSize );
#if( configUSE_MALLOC_FAILED_HOOK == 1 )
if( pvReturn == NULL )
{
extern void vApplicationMallocFailedHook( void );
vApplicationMallocFailedHook();
}
#endif
return pvReturn;
}
void vPortFree( void *pv )
{
if( pv )
{
free_dtcm( pv );
traceFREE( pv, 0 );
}
}