]> 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 af57585a3848316047e52ca19be992bc9b20e9dd..8a770c9519d68c2f86de513f4318963c1be4eceb 100644 (file)
@@ -1,48 +1,38 @@
 /*\r
-    FreeRTOS V7.4.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
-    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
-    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
     ***************************************************************************\r
      *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
      *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
      *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
-     *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *    Thank you!                                                         *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-\r
     This file is part of the FreeRTOS distribution.\r
 \r
     FreeRTOS is free software; you can redistribute it and/or modify it under\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
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide 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
-    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
-    details. You should have received a copy of the GNU General Public License\r
-    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
-    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
-    writing to Real Time Engineers Ltd., contact details for whom are available\r
-    on the FreeRTOS WEB site.\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\r
 \r
     1 tab == 4 spaces!\r
 \r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-\r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
     license and Real Time Engineers Ltd. contact details.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
-    fully thread aware and reentrant UDP/IP stack.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
-    Integrity Systems, who sell the code with commercial support, \r
-    indemnification and middleware, under the OpenRTOS brand.\r
-    \r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
-    engineered and independently SIL3 certified version for use in safety and \r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
     mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
 */\r
 \r
 /*\r
@@ -111,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
@@ -145,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
@@ -155,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
@@ -181,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
@@ -193,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
@@ -233,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
@@ -246,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
@@ -286,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
@@ -343,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
@@ -402,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