]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/croutine.c
Added more files to the Rowley and IAR LM3S demos to test building the newer files...
[freertos] / FreeRTOS / Source / croutine.c
index d428dcccac6385a4f35fce84b66f0bfcfef80dc1..c2fdc50fe2bedcdccf446469a1d83860e9035fd9 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
     FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
 \r
-    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT \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
 \r
     ***************************************************************************\r
@@ -42,7 +42,7 @@
     FreeRTOS WEB site.\r
 \r
     1 tab == 4 spaces!\r
-    \r
+\r
     ***************************************************************************\r
      *                                                                       *\r
      *    Having a problem?  Start by reading the FAQ "My application does   *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-    \r
-    http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
-    and contact details.  \r
-    \r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool.\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
+    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
+    provide a safety engineered and independently SIL3 certified version under\r
     the SafeRTOS brand: http://www.SafeRTOS.com.\r
 */\r
 \r
@@ -85,7 +85,7 @@ static xList xDelayedCoRoutineList1;                                                                  /*< Delayed co-routines. */
 static xList xDelayedCoRoutineList2;                                                                   /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */\r
 static xList * pxDelayedCoRoutineList;                                                                 /*< Points to the delayed co-routine list currently being used. */\r
 static xList * pxOverflowDelayedCoRoutineList;                                                 /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */\r
-static xList xPendingReadyCoRoutineList;                                                                                       /*< Holds co-routines that have been readied by an external event.  They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */\r
+static xList xPendingReadyCoRoutineList;                                                               /*< Holds co-routines that have been readied by an external event.  They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */\r
 \r
 /* Other file private variables. --------------------------------*/\r
 corCRCB * pxCurrentCoRoutine = NULL;\r
@@ -109,7 +109,7 @@ static portTickType xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks =
                uxTopCoRoutineReadyPriority = pxCRCB->uxPriority;                                                                                                                       \\r
        }                                                                                                                                                                                                                               \\r
        vListInsertEnd( ( xList * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) );  \\r
-}      \r
+}\r
 \r
 /*\r
  * Utility to ready all the lists used by the scheduler.  This is called\r
@@ -175,10 +175,10 @@ corCRCB *pxCoRoutine;
                in a list. */\r
                listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );\r
                listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );\r
-       \r
+\r
                /* Event lists are always in priority order. */\r
                listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) uxPriority );\r
-               \r
+\r
                /* Now the co-routine has been initialised it can be added to the ready\r
                list at the correct priority. */\r
                prvAddCoRoutineToReadyQueue( pxCoRoutine );\r
@@ -186,11 +186,11 @@ corCRCB *pxCoRoutine;
                xReturn = pdPASS;\r
        }\r
        else\r
-       {               \r
+       {\r
                xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;\r
        }\r
-       \r
-       return xReturn; \r
+\r
+       return xReturn;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -243,14 +243,14 @@ static void prvCheckPendingReadyList( void )
 \r
                /* The pending ready list can be accessed by an ISR. */\r
                portDISABLE_INTERRUPTS();\r
-               {       \r
-                       pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) );                   \r
+               {\r
+                       pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) );\r
                        uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
                }\r
                portENABLE_INTERRUPTS();\r
 \r
                uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );\r
-               prvAddCoRoutineToReadyQueue( pxUnblockedCRCB ); \r
+               prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -282,11 +282,11 @@ corCRCB *pxCRCB;
                {\r
                        pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );\r
 \r
-                       if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )                            \r
-                       {                       \r
-                               /* Timeout not yet expired. */                                                                                                                                                  \r
-                               break;                                                                                                                                                          \r
-                       }                                                                                                                                                                               \r
+                       if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )\r
+                       {\r
+                               /* Timeout not yet expired. */\r
+                               break;\r
+                       }\r
 \r
                        portDISABLE_INTERRUPTS();\r
                        {\r
@@ -295,18 +295,18 @@ corCRCB *pxCRCB;
                                have been moved to the pending ready list and the following\r
                                line is still valid.  Also the pvContainer parameter will have\r
                                been set to NULL so the following lines are also valid. */\r
-                               uxListRemove( &( pxCRCB->xGenericListItem ) );                                                                                  \r
+                               uxListRemove( &( pxCRCB->xGenericListItem ) );\r
 \r
-                               /* Is the co-routine waiting on an event also? */                                                                                               \r
-                               if( pxCRCB->xEventListItem.pvContainer )                                                                                                        \r
-                               {                                                                                                                       \r
-                                       uxListRemove( &( pxCRCB->xEventListItem ) );                                                                                    \r
+                               /* Is the co-routine waiting on an event also? */\r
+                               if( pxCRCB->xEventListItem.pvContainer )\r
+                               {\r
+                                       uxListRemove( &( pxCRCB->xEventListItem ) );\r
                                }\r
                        }\r
                        portENABLE_INTERRUPTS();\r
 \r
-                       prvAddCoRoutineToReadyQueue( pxCRCB );                                                                                                  \r
-               }                                                                                                                                                                                                       \r
+                       prvAddCoRoutineToReadyQueue( pxCRCB );\r
+               }\r
        }\r
 \r
        xLastTickCount = xCoRoutineTickCount;\r