mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Changed the MicroBlaze demo back to using heap_3.c having updated the linker script generation.
This commit is contained in:
parent
08d7c89175
commit
39f8526265
|
@ -68,7 +68,7 @@ IF EXIST FreeRTOS_Source Goto END
|
|||
copy %FREERTOS_SOURCE%\portable\MemMang\heap_3.c FreeRTOS_Source\portable\MemMang
|
||||
|
||||
REM Copy the basic memory allocation files into the BSP directory
|
||||
copy %FREERTOS_SOURCE%\portable\MemMang\heap_2.c %BSP_SOURCE%\portable\MemMang
|
||||
copy %FREERTOS_SOURCE%\portable\MemMang\heap_3.c %BSP_SOURCE%\portable\MemMang
|
||||
|
||||
REM Copy the files that define the common demo tasks.
|
||||
copy %COMMON_SOURCE%\dynamic.c Demo_Source
|
||||
|
|
|
@ -422,29 +422,37 @@ void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName
|
|||
|
||||
void vApplicationIdleHook( void )
|
||||
{
|
||||
volatile size_t xFreeHeapSpace;
|
||||
#ifdef EXAMPLE_CODE_ONLY
|
||||
|
||||
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
||||
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
||||
task. It is essential that code added to this hook function never attempts
|
||||
to block in any way (for example, call xQueueReceive() with a block time
|
||||
specified, or call vTaskDelay()). If the application makes use of the
|
||||
vTaskDelete() API function (as this demo application does) then it is also
|
||||
important that vApplicationIdleHook() is permitted to return to its calling
|
||||
function, because it is the responsibility of the idle task to clean up
|
||||
memory allocated by the kernel to any task that has since been deleted. */
|
||||
The following code can only be included if heap_1.c or heap_2.c is used in
|
||||
the project. By default, heap_3.c is used, so the example code is
|
||||
excluded. See http://www.freertos.org/a00111.html for more information on
|
||||
memory management options.
|
||||
|
||||
/* This implementation of vApplicationIdleHook() simply demonstrates how
|
||||
the xPortGetFreeHeapSize() function can be used. */
|
||||
xFreeHeapSpace = xPortGetFreeHeapSize();
|
||||
volatile size_t xFreeHeapSpace;
|
||||
|
||||
if( xFreeHeapSpace > 100 )
|
||||
{
|
||||
/* By now, the kernel has allocated everything it is going to, so
|
||||
if there is a lot of heap remaining unallocated then
|
||||
the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be
|
||||
reduced accordingly. */
|
||||
}
|
||||
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
||||
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
||||
task. It is essential that code added to this hook function never attempts
|
||||
to block in any way (for example, call xQueueReceive() with a block time
|
||||
specified, or call vTaskDelay()). If the application makes use of the
|
||||
vTaskDelete() API function (as this demo application does) then it is also
|
||||
important that vApplicationIdleHook() is permitted to return to its calling
|
||||
function, because it is the responsibility of the idle task to clean up
|
||||
memory allocated by the kernel to any task that has since been deleted. */
|
||||
|
||||
/* This implementation of vApplicationIdleHook() simply demonstrates how
|
||||
the xPortGetFreeHeapSize() function can be used. */
|
||||
xFreeHeapSpace = xPortGetFreeHeapSize();
|
||||
|
||||
if( xFreeHeapSpace > 100 )
|
||||
{
|
||||
/* By now, the kernel has allocated everything it is going to, so
|
||||
if there is a lot of heap remaining unallocated then
|
||||
the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be
|
||||
reduced accordingly. */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
/*******************************************************************/
|
||||
|
||||
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400;
|
||||
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x8;
|
||||
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x10400;
|
||||
|
||||
/* Define Memories in the system */
|
||||
|
||||
|
|
Loading…
Reference in a new issue