Update register test tasks to include a manual yield. Include the death tasks in main-full.c. Decrease the RAM allocated to the heap in FreeRTOSConfig.h.

This commit is contained in:
Richard Barry 2011-06-13 14:41:18 +00:00
parent 1cb4a1494f
commit 587e7f0682
3 changed files with 26 additions and 18 deletions

View File

@ -83,7 +83,7 @@
#define configCPU_CLOCK_HZ ( XPAR_MICROBLAZE_CORE_CLOCK_FREQ_HZ ) /* Not actually used in this demo as the timer is set up in main and uses the peripheral clock, not the CPU clock. */
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 200 * 1024 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 64 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
@ -96,7 +96,7 @@
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 250 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 )
#define configINTERRUPT_STACK_SIZE configMINIMAL_STACK_SIZE
/* Co-routine definitions. */

View File

@ -53,6 +53,7 @@
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
/*
* The register test task as described at the top of this file.
@ -183,16 +184,7 @@ void vRegisterTest2( void *pvParameters )
code.
First fill the registers with known values. */
asm volatile ( " addi r3, r0, 103 \n\t" \
" addi r4, r0, 104 \n\t" \
" addi r6, r0, 106 \n\t" \
" addi r7, r0, 107 \n\t" \
" addi r8, r0, 108 \n\t" \
" addi r9, r0, 109 \n\t" \
" addi r10, r0, 1010 \n\t" \
" addi r11, r0, 1011 \n\t" \
" addi r12, r0, 1012 \n\t" \
" addi r16, r0, 1016 \n\t" \
asm volatile ( " addi r16, r0, 1016 \n\t" \
" addi r19, r0, 1019 \n\t" \
" addi r20, r0, 1020 \n\t" \
" addi r21, r0, 1021 \n\t" \
@ -205,13 +197,26 @@ void vRegisterTest2( void *pvParameters )
" addi r28, r0, 1028 \n\t" \
" addi r29, r0, 1029 \n\t" \
" addi r30, r0, 1030 \n\t" \
" addi r31, r0, 1031 \n\t"
" addi r31, r0, 1031 \n\t" \
" " \
"Loop_Start_2: "
);
/* Yield. */
asm volatile ( "Loop_Start_2: \n\t" \
"bralid r14, VPortYieldASM \n\t" \
"or r0, r0, r0 \n\t" );
taskYIELD();
asm volatile ( " addi r3, r0, 103 \n\t" \
" addi r4, r0, 104 \n\t" \
" addi r6, r0, 106 \n\t" \
" addi r7, r0, 107 \n\t" \
" addi r8, r0, 108 \n\t" \
" addi r9, r0, 109 \n\t" \
" addi r10, r0, 1010 \n\t" \
" addi r11, r0, 1011 \n\t" \
" addi r12, r0, 1012 \n\t" \
);
/* taskYIELD() could have changed temporaries - set them back to those
expected by the reg test task. */
/* Now test the register values to ensure they contain the same value that
was written to them above. This task will get preempted frequently so

View File

@ -276,7 +276,7 @@ int main( void )
/* The suicide tasks must be created last as they need to know how many
tasks were running prior to their creation in order to ascertain whether
or not the correct/expected number of tasks are running at any given time. */
// vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
/* Create the 'check' timer - the timer that periodically calls the
check function as described at the top of this file. Note that, for
@ -297,6 +297,7 @@ int main( void )
/* If all is well we will never reach here as the scheduler will now be
running. If we do reach here then it is likely that there was insufficient
heap available for the idle task to be created. */
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
@ -465,6 +466,7 @@ unsigned long ulCSR;
of this file. */
void vApplicationMallocFailedHook( void )
{
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/
@ -473,6 +475,7 @@ void vApplicationMallocFailedHook( void )
of this file. */
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )
{
taskDISABLE_INTERRUPTS();
for( ;; );
}
/*-----------------------------------------------------------*/