From: richardbarry Date: Mon, 13 Jun 2011 14:41:18 +0000 (+0000) Subject: Update register test tasks to include a manual yield. Include the death tasks in... X-Git-Tag: V7.0.2~154 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=defeae14fcc47222a5110b4d82eab934dfb132ea;p=freertos 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. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1456 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h index 63162ec94..81e8b79de 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h @@ -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. */ diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/RegisterTests.c b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/RegisterTests.c index a855e564b..906e306db 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/RegisterTests.c +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/RegisterTests.c @@ -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: " + ); + + 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" \ ); - /* Yield. */ - asm volatile ( "Loop_Start_2: \n\t" \ - "bralid r14, VPortYieldASM \n\t" \ - "or r0, r0, r0 \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 diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c index 385f0873a..3d1524805 100644 --- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c +++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c @@ -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( ;; ); } /*-----------------------------------------------------------*/