]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main.c
Kernel changes:
[freertos] / FreeRTOS / Demo / CORTEX_M4_ATSAM4E_Atmel_Studio / src / main.c
index 5adaecdbfaf6fe7eefa6d275fd4bfd7e829cfbce..4f3ddcebb6fae33965218f303b36421ea4340e53 100644 (file)
@@ -141,6 +141,8 @@ static void prvSetupHardware( void )
 \r
 void vApplicationMallocFailedHook( void )\r
 {\r
+static volatile uint32_t ulCount = 0;\r
+\r
        /* vApplicationMallocFailedHook() will only be called if\r
        configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
        function that will get called if a call to pvPortMalloc() fails.\r
@@ -150,8 +152,12 @@ void vApplicationMallocFailedHook( void )
        heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in\r
        FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used\r
        to query the size of free heap space that remains (although it does not\r
-       provide information on how the remaining heap might be fragmented). */\r
-       vAssertCalled( __LINE__, __FILE__ );\r
+       provide information on how the remaining heap might be fragmented). \r
+       \r
+       Just count the number of malloc fails as some failures may occur simply\r
+       because the network load is very high, resulting in the consumption of a\r
+       lot of network buffers. */\r
+       ulCount++;      \r
 }\r
 /*-----------------------------------------------------------*/\r
 \r