74 #ifdef portREMOVE_STATIC_QUALIFIER
81 static xList xDelayedCoRoutineList1;
82 static xList xDelayedCoRoutineList2;
83 static xList * pxDelayedCoRoutineList;
84 static xList * pxOverflowDelayedCoRoutineList;
85 static xList xPendingReadyCoRoutineList;
89 static unsigned portBASE_TYPE uxTopCoRoutineReadyPriority = 0;
90 static portTickType xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
93 #define corINITIAL_STATE ( 0 )
102 #define prvAddCoRoutineToReadyQueue( pxCRCB ) \
104 if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
106 uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
108 vListInsertEnd( ( xList * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
115 static void prvInitialiseCoRoutineLists(
void );
123 static void prvCheckPendingReadyList(
void );
133 static void prvCheckDelayedList(
void );
148 if( pxCurrentCoRoutine ==
NULL )
150 pxCurrentCoRoutine = pxCoRoutine;
151 prvInitialiseCoRoutineLists();
163 pxCoRoutine->
uxIndex = uxIndex;
200 xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
210 if( xTimeToWake < xCoRoutineTickCount )
232 static void prvCheckPendingReadyList(
void )
255 static void prvCheckDelayedList(
void )
260 while( xPassedTicks )
262 xCoRoutineTickCount++;
266 if( xCoRoutineTickCount == 0 )
272 pxTemp = pxDelayedCoRoutineList;
273 pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
274 pxOverflowDelayedCoRoutineList = pxTemp;
309 xLastTickCount = xCoRoutineTickCount;
316 prvCheckPendingReadyList();
319 prvCheckDelayedList();
322 while(
listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
324 if( uxTopCoRoutineReadyPriority == 0 )
329 --uxTopCoRoutineReadyPriority;
343 static void prvInitialiseCoRoutineLists(
void )
358 pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
359 pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;