]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/tasks.c
Update version numbers to V7.4.1.
[freertos] / FreeRTOS / Source / tasks.c
index 82e991fd2151ebc761eeef79e0b07a42440cf0e3..bdf84b43cc1107c074a0112c43681701d62439ea 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+    FreeRTOS V7.4.1 - Copyright (C) 2013 Real Time Engineers Ltd.\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
     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
-    >>>NOTE<<< The modification to the GPL is included to allow you to\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.  FreeRTOS is distributed in the hope that it will be useful, but\r
-    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
-    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
-    more details. You should have received a copy of the GNU General Public\r
-    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
-    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
-    by writing to Richard Barry, contact details for whom are available on the\r
-    FreeRTOS WEB site.\r
+    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 it can 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
 \r
     1 tab == 4 spaces!\r
 \r
     ***************************************************************************\r
 \r
 \r
-    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
-    and contact details.\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.\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
-    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
-    the code with commercial support, indemnification, and middleware, under\r
-    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
-    provide a safety engineered and independently SIL3 certified version under\r
-    the SafeRTOS brand: http://www.SafeRTOS.com.\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
 \r
 /* Standard includes. */\r
@@ -198,7 +204,7 @@ PRIVILEGED_DATA static volatile portTickType xNextTaskUnblockTime                           = ( portTic
 \r
        PRIVILEGED_DATA static char pcStatsString[ 50 ] ;\r
        PRIVILEGED_DATA static unsigned long ulTaskSwitchedInTime = 0UL;        /*< Holds the value of a timer/counter the last time a task was switched in. */\r
-       PRIVILEGED_DATA static unsigned long ulTotalRunTime;                            /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
+       PRIVILEGED_DATA static unsigned long ulTotalRunTime = 0UL;                              /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
        static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTimeDiv100 ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
@@ -936,7 +942,7 @@ tskTCB * pxNewTCB;
 \r
                taskENTER_CRITICAL();\r
                {\r
-                       if( xTask == pxCurrentTCB )\r
+                       if( xTask == ( xTaskHandle ) pxCurrentTCB )\r
                        {\r
                                xTask = NULL;\r
                        }\r
@@ -1024,13 +1030,13 @@ tskTCB * pxNewTCB;
                                {\r
                                        portYIELD_WITHIN_API();\r
                                }\r
+\r
+                               /* Remove compiler warning about unused variables when the port\r
+                               optimised task selection is not being used. */\r
+                               ( void ) uxPriorityUsedOnEntry;\r
                        }\r
                }\r
                taskEXIT_CRITICAL();\r
-\r
-               /* Remove compiler warning about unused parameter when the port\r
-               optimised task selection is not being used. */\r
-               ( void ) uxPriorityUsedOnEntry;\r
        }\r
 \r
 #endif /* INCLUDE_vTaskPrioritySet */\r
@@ -1046,7 +1052,7 @@ tskTCB * pxNewTCB;
                {\r
                        /* Ensure a yield is performed if the current task is being\r
                        suspended. */\r
-                       if( xTaskToSuspend == pxCurrentTCB )\r
+                       if( xTaskToSuspend == ( xTaskHandle ) pxCurrentTCB )\r
                        {\r
                                xTaskToSuspend = NULL;\r
                        }\r
@@ -2145,6 +2151,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
                #if ( configUSE_TICKLESS_IDLE != 0 )\r
                {\r
                portTickType xExpectedIdleTime;\r
+\r
                        /* It is not desirable to suspend then resume the scheduler on\r
                        each iteration of the idle task.  Therefore, a preliminary\r
                        test of the expected idle time is performed without the\r