mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Exercise the new vPortGetHeapStats() function from the Win32 demo projects.
This commit is contained in:
parent
fa404422b9
commit
4d6570b009
7 changed files with 113 additions and 9 deletions
Binary file not shown.
|
|
@ -62,7 +62,8 @@
|
|||
#define configUSE_ALTERNATIVE_API 0
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
#define configUSE_TASK_NOTIFICATIONS 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 0
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
|
||||
/* Software timer related configuration options. */
|
||||
#define configUSE_TIMERS 1
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@
|
|||
<ClCompile Include="..\..\Source\event_groups.c" />
|
||||
<ClCompile Include="..\..\Source\portable\MemMang\heap_5.c" />
|
||||
<ClCompile Include="..\..\Source\stream_buffer.c" />
|
||||
<ClCompile Include="..\..\Source\task_pool.c" />
|
||||
<ClCompile Include="..\..\Source\timers.c" />
|
||||
<ClCompile Include="..\Common\Minimal\AbortDelay.c" />
|
||||
<ClCompile Include="..\Common\Minimal\BlockQ.c" />
|
||||
|
|
|
|||
|
|
@ -160,6 +160,9 @@
|
|||
<ClCompile Include="..\Common\Minimal\MessageBufferAMP.c">
|
||||
<Filter>Demo App Source\Full_Demo\Common Demo Tasks</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Source\task_pool.c">
|
||||
<Filter>FreeRTOS Source\Source</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="FreeRTOSConfig.h">
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ static void prvCheckTask( void *pvParameters )
|
|||
{
|
||||
TickType_t xNextWakeTime;
|
||||
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 4000UL );
|
||||
HeapStats_t xHeapStats;
|
||||
|
||||
/* Just to remove compiler warning. */
|
||||
( void ) pvParameters;
|
||||
|
|
@ -370,10 +371,17 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 4000UL );
|
|||
|
||||
/* This is the only task that uses stdout so its ok to call printf()
|
||||
directly. */
|
||||
printf( "%s - tick count %zu - free heap %zu - min free heap %zu\r\n", pcStatusMessage,
|
||||
xTaskGetTickCount(),
|
||||
xPortGetFreeHeapSize(),
|
||||
xPortGetMinimumEverFreeHeapSize() );
|
||||
vPortGetHeapStats( &xHeapStats );
|
||||
|
||||
configASSERT( xHeapStats.xAvailableHeapSpaceInBytes == xPortGetFreeHeapSize() );
|
||||
configASSERT( xHeapStats.xMinimumEverFreeBytesRemaining == xPortGetMinimumEverFreeHeapSize() );
|
||||
|
||||
printf( "%s - tick count %zu - free heap %zu - min free heap %zu - largest free block %zu \r\n",
|
||||
pcStatusMessage,
|
||||
xTaskGetTickCount(),
|
||||
xHeapStats.xAvailableHeapSpaceInBytes,
|
||||
xHeapStats.xMinimumEverFreeBytesRemaining,
|
||||
xHeapStats.xSizeOfLargestFreeBlockInBytes );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue