]> git.sur5r.net Git - freertos/commitdiff
Ensure previous modification does not prevent compilation when INCLUDE_vTaskSuspend...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 28 Oct 2006 09:47:41 +0000 (09:47 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 28 Oct 2006 09:47:41 +0000 (09:47 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@51 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

index 9b722bf756dcdd5bfaf95e681060f835097c426c..3b699035543e16e8927423c4e175ae82fb53a81b 100644 (file)
@@ -1429,32 +1429,56 @@ portTickType xTimeToWake;
        exclusive access to the ready lists as the scheduler is locked. */\r
        vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
 \r
-       if( xTicksToWait == portMAX_DELAY )\r
-       {\r
-               /* Add ourselves to the suspended task list instead of a delayed task\r
-               list to ensure we are not woken by a timing event.  We will block\r
-               indefinitely. */\r
-               vListInsertEnd( ( xList * ) &xSuspendedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
-       }\r
-       else\r
-       {\r
-               /* Calculate the time at which the task should be woken if the event does\r
-               not occur.  This may overflow but this doesn't matter. */\r
-               xTimeToWake = xTickCount + xTicksToWait;\r
-       \r
-               listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );\r
-       \r
-               if( xTimeToWake < xTickCount )\r
+\r
+       #if ( INCLUDE_vTaskSuspend == 1 )\r
+       {                        \r
+               if( xTicksToWait == portMAX_DELAY )\r
                {\r
-                       /* Wake time has overflowed.  Place this item in the overflow list. */\r
-                       vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       /* Add ourselves to the suspended task list instead of a delayed task\r
+                       list to ensure we are not woken by a timing event.  We will block\r
+                       indefinitely. */\r
+                       vListInsertEnd( ( xList * ) &xSuspendedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
                }\r
                else\r
                {\r
-                       /* The wake time has not overflowed, so we can use the current block list. */\r
-                       vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       /* Calculate the time at which the task should be woken if the event does\r
+                       not occur.  This may overflow but this doesn't matter. */\r
+                       xTimeToWake = xTickCount + xTicksToWait;\r
+               \r
+                       listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );\r
+               \r
+                       if( xTimeToWake < xTickCount )\r
+                       {\r
+                               /* Wake time has overflowed.  Place this item in the overflow list. */\r
+                               vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The wake time has not overflowed, so we can use the current block list. */\r
+                               vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       }\r
                }\r
        }\r
+       #else\r
+       {\r
+                       /* Calculate the time at which the task should be woken if the event does\r
+                       not occur.  This may overflow but this doesn't matter. */\r
+                       xTimeToWake = xTickCount + xTicksToWait;\r
+               \r
+                       listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );\r
+               \r
+                       if( xTimeToWake < xTickCount )\r
+                       {\r
+                               /* Wake time has overflowed.  Place this item in the overflow list. */\r
+                               vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The wake time has not overflowed, so we can use the current block list. */\r
+                               vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+                       }\r
+       }\r
+       #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r