]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/tasks.c
Minor mods common files to fix warnings generated by Renesas compiler.
[freertos] / FreeRTOS / Source / tasks.c
index 51b75b4e696aae0d9551395fe73641f32c4bfd38..ef92565c20b077696ad3a35942360953139e8d26 100644 (file)
     ***************************************************************************\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
+    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
+\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
@@ -204,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
@@ -709,6 +709,14 @@ tskTCB * pxNewTCB;
                        if( ( void * ) xTaskToDelete == NULL )\r
                        {\r
                                portYIELD_WITHIN_API();\r
+\r
+                               /* Ensure the task goes no further if it takes a few\r
+                               instructions for the yield to occur. */\r
+                               for( ;; )\r
+                               {\r
+                                       /* Nothing to do here, just ensuring the task does not\r
+                                       execute further before the yield has taken effect. */\r
+                               }\r
                        }\r
                }\r
        }\r
@@ -1030,13 +1038,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
@@ -2151,6 +2159,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