]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / PPC405_Xilinx_Virtex4_GCC / RTOSDemo / flop / flop.c
index bd2b3aff6d8498b045bd1a71f437981e0d6330d7..8a770c9519d68c2f86de513f4318963c1be4eceb 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
-    FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd. \r
+    All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
@@ -101,19 +102,19 @@ static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters );
 \r
 /* These variables are used to check that all the tasks are still running.  If a \r
 task gets a calculation wrong it will stop incrementing its check variable. */\r
-static volatile unsigned portSHORT usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };\r
+static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
 \r
 /* Buffers into which the flop registers will be saved.  There is a buffer for \r
 each task created within this file.  Zeroing out this array is the normal and\r
 safe option as this will cause the task to start with all zeros in its flop\r
 context. */\r
-static unsigned portLONG ulFlopRegisters[ mathNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];\r
+static unsigned long ulFlopRegisters[ mathNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
 {\r
-xTaskHandle xTaskJustCreated;\r
+TaskHandle_t xTaskJustCreated;\r
 portBASE_TYPE x, y;\r
 \r
        /* Place known values into the buffers into which the flop registers are \r
@@ -135,7 +136,7 @@ portBASE_TYPE x, y;
        /* Create the first task - passing it the address of the check variable\r
        that it is going to increment.  This check variable is used as an \r
        indication that the task is still running. */\r
-       xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
+       xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, &xTaskJustCreated );\r
 \r
        /* The task     tag value is a value that can be associated with a task, but \r
        is not used by the scheduler itself.  Its use is down to the application so\r
@@ -145,25 +146,25 @@ portBASE_TYPE x, y;
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 0 ][ 0 ] ) );\r
 \r
        /* Create another 7 tasks, allocating a buffer for each. */\r
-       xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 1 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask3, "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 2 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask4, "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 3 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask1, "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 4 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask2, "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 5 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask3, "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 6 ][ 0 ] ) );\r
 \r
-       xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated  );\r
+       xTaskCreate( vCompetingMathTask4, "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, &xTaskJustCreated  );\r
        vTaskSetApplicationTaskTag( xTaskJustCreated, ( void * ) &( ulFlopRegisters[ 7 ][ 0 ] ) );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -171,9 +172,9 @@ portBASE_TYPE x, y;
 static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )\r
 {\r
 volatile portFLOAT ff1, ff2, ff3, ff4;\r
-volatile unsigned portSHORT *pusTaskCheckVariable;\r
+volatile unsigned short *pusTaskCheckVariable;\r
 volatile portFLOAT fAnswer;\r
-portSHORT sError = pdFALSE;\r
+short sError = pdFALSE;\r
 \r
        ff1 = 123.4567F;\r
        ff2 = 2345.6789F;\r
@@ -183,7 +184,7 @@ portSHORT sError = pdFALSE;
 \r
        /* The variable this task increments to show it is still running is passed in \r
        as the parameter. */\r
-       pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;\r
+       pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
 \r
        /* Keep performing a calculation and checking the result against a constant. */\r
        for(;;)\r
@@ -223,9 +224,9 @@ portSHORT sError = pdFALSE;
 static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )\r
 {\r
 volatile portFLOAT ff1, ff2, ff3, ff4;\r
-volatile unsigned portSHORT *pusTaskCheckVariable;\r
+volatile unsigned short *pusTaskCheckVariable;\r
 volatile portFLOAT fAnswer;\r
-portSHORT sError = pdFALSE;\r
+short sError = pdFALSE;\r
 \r
        ff1 = -389.38F;\r
        ff2 = 32498.2F;\r
@@ -236,7 +237,7 @@ portSHORT sError = pdFALSE;
 \r
        /* The variable this task increments to show it is still running is passed in \r
        as the parameter. */\r
-       pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;\r
+       pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
 \r
        /* Keep performing a calculation and checking the result against a constant. */\r
        for( ;; )\r
@@ -276,14 +277,14 @@ portSHORT sError = pdFALSE;
 static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )\r
 {\r
 volatile portFLOAT *pfArray, fTotal1, fTotal2, fDifference;\r
-volatile unsigned portSHORT *pusTaskCheckVariable;\r
+volatile unsigned short *pusTaskCheckVariable;\r
 const size_t xArraySize = 10;\r
 size_t xPosition;\r
-portSHORT sError = pdFALSE;\r
+short sError = pdFALSE;\r
 \r
        /* The variable this task increments to show it is still running is passed in \r
        as the parameter. */\r
-       pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;\r
+       pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
 \r
        pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) );\r
 \r
@@ -333,14 +334,14 @@ portSHORT sError = pdFALSE;
 static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )\r
 {\r
 volatile portFLOAT *pfArray, fTotal1, fTotal2, fDifference;\r
-volatile unsigned portSHORT *pusTaskCheckVariable;\r
+volatile unsigned short *pusTaskCheckVariable;\r
 const size_t xArraySize = 10;\r
 size_t xPosition;\r
-portSHORT sError = pdFALSE;\r
+short sError = pdFALSE;\r
 \r
        /* The variable this task increments to show it is still running is passed in \r
        as the parameter. */\r
-       pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;\r
+       pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
 \r
        pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) );\r
 \r
@@ -392,7 +393,7 @@ portBASE_TYPE xAreMathsTaskStillRunning( void )
 {\r
 /* Keep a history of the check variables so we know if they have been incremented \r
 since the last call. */\r
-static unsigned portSHORT usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };\r
+static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
 portBASE_TYPE xReturn = pdTRUE, xTask;\r
 \r
        /* Check the maths tasks are still running by ensuring their check variables \r