]> git.sur5r.net Git - freertos/blobdiff - Source/croutine.c
Update the sys tick to be more efficient.
[freertos] / Source / croutine.c
index 02ad546bb188ea7cc347ffff4b94511161ca3636..da93da4e20434d98bf6353408e33a0d315d70deb 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-       FreeRTOS.org V4.0.5 - Copyright (C) 2003-2006 Richard Barry.\r
+       FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry.\r
 \r
        This file is part of the FreeRTOS.org distribution.\r
 \r
        of http://www.FreeRTOS.org for full details of how and when the exception\r
        can be applied.\r
 \r
-       ***************************************************************************\r
-       See http://www.FreeRTOS.org for documentation, latest information, license\r
-       and contact details.  Please ensure to read the configuration and relevant\r
-       port sections of the online documentation.\r
-       ***************************************************************************\r
+    ***************************************************************************\r
+    ***************************************************************************\r
+    *                                                                         *\r
+    * SAVE TIME AND MONEY!  We can port FreeRTOS.org to your own hardware,    *\r
+    * and even write all or part of your application on your behalf.          *\r
+    * See http://www.OpenRTOS.com for details of the services we provide to   *\r
+    * expedite your project.                                                  *\r
+    *                                                                         *\r
+    ***************************************************************************\r
+    ***************************************************************************\r
+\r
+       Please ensure to read the configuration and relevant port sections of the\r
+       online documentation.\r
+\r
+       http://www.FreeRTOS.org - Documentation, latest information, license and \r
+       contact details.\r
+\r
+       http://www.SafeRTOS.com - A version that is certified for use in safety \r
+       critical systems.\r
+\r
+       http://www.OpenRTOS.com - Commercial support, development, porting, \r
+       licensing and training services.\r
 */\r
 \r
 #include "FreeRTOS.h"\r
@@ -51,8 +68,8 @@ static portTickType xCoRoutineTickCount = 0;
 #define corINITIAL_STATE       ( 0 )\r
 \r
 /*\r
- * Place the co-routine represented by pxCRCB into the appropriate ready queue \r
- * for the priority.  It is inserted at the end of the list.  \r
+ * Place the co-routine represented by pxCRCB into the appropriate ready queue\r
+ * for the priority.  It is inserted at the end of the list.\r
  *\r
  * This macro accesses the co-routine ready lists and therefore must not be\r
  * used from within an ISR.\r
@@ -81,20 +98,20 @@ static void prvInitialiseCoRoutineLists( void );
 static inline void prvCheckPendingReadyList( void );\r
 \r
 /*\r
- * Macro that looks at the list of co-routines that are currently delayed to \r
+ * Macro that looks at the list of co-routines that are currently delayed to\r
  * see if any require waking.\r
  *\r
- * Co-routines are stored in the queue in the order of their wake time - \r
- * meaning once one co-routine has been found whose timer has not expired \r
+ * Co-routines are stored in the queue in the order of their wake time -\r
+ * meaning once one co-routine has been found whose timer has not expired\r
  * we need not look any further down the list.\r
  */\r
 static inline void prvCheckDelayedList( void );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )\r
+signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )\r
 {\r
-portBASE_TYPE xReturn;\r
+signed portBASE_TYPE xReturn;\r
 corCRCB *pxCoRoutine;\r
 \r
        /* Allocate the memory that will store the co-routine control block. */\r
@@ -125,8 +142,8 @@ corCRCB *pxCoRoutine;
                vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );\r
                vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );\r
 \r
-               /* Set the co-routine control block as a link back from the xListItem.  \r
-               This is so we can get back to the containing CRCB from a generic item \r
+               /* Set the co-routine control block as a link back from the xListItem.\r
+               This is so we can get back to the containing CRCB from a generic item\r
                in a list. */\r
                listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );\r
                listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );\r
@@ -190,7 +207,7 @@ portTickType xTimeToWake;
 static inline void prvCheckPendingReadyList( void )\r
 {\r
        /* Are there any co-routines waiting to get moved to the ready list?  These\r
-       are co-routines that have been readied by an ISR.  The ISR cannot access \r
+       are co-routines that have been readied by an ISR.  The ISR cannot access\r
        the     ready lists itself. */\r
        while( !listLIST_IS_EMPTY( &xPendingReadyList ) )\r
        {\r
@@ -244,9 +261,9 @@ corCRCB *pxCRCB;
 \r
                        portDISABLE_INTERRUPTS();\r
                        {\r
-                               /* The event could have occurred just before this critical \r
+                               /* The event could have occurred just before this critical\r
                                section.  If this is the case then the generic list item will\r
-                               have been moved to the pending ready list and the following \r
+                               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
                                vListRemove( &( pxCRCB->xGenericListItem ) );                                                                                   \r
@@ -310,17 +327,17 @@ unsigned portBASE_TYPE uxPriority;
        vListInitialise( ( xList * ) &xDelayedCoRoutineList2 );\r
        vListInitialise( ( xList * ) &xPendingReadyList );\r
 \r
-       /* Start with pxDelayedCoRoutineList using list1 and the \r
+       /* Start with pxDelayedCoRoutineList using list1 and the\r
        pxOverflowDelayedCoRoutineList using list2. */\r
        pxDelayedCoRoutineList = &xDelayedCoRoutineList1;\r
        pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )\r
+signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )\r
 {\r
 corCRCB *pxUnblockedCRCB;\r
-portBASE_TYPE xReturn;\r
+signed portBASE_TYPE xReturn;\r
 \r
        /* This function is called from within an interrupt.  It can only access\r
        event lists and the pending ready list. */\r