Lines Matching +full:- +full:- +full:check

5  * SPDX-License-Identifier: MIT
33 /* Remove the whole file is co-routines are not being used. */
45 /* Lists for ready and blocked co-routines. --------------------*/
46 …t_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
47 …static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
48 …outineList2; /*< Delayed co-routines (two lists are used - one f…
49 …dCoRoutineList = NULL; /*< Points to the delayed co-routine list currentl…
50 …= NULL; /*< Points to the delayed co-routine list currently being used to hold co
51 …static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that…
53 /* Other file private variables. --------------------------------*/
58 /* The initial state of the co-routine when it is created. */
62 * Place the co-routine represented by pxCRCB into the appropriate ready queue
65 * This macro accesses the co-routine ready lists and therefore must not be
70 …if( ( pxCRCB )->uxPriority > uxTopCoRoutineReadyPriority ) …
72 …uxTopCoRoutineReadyPriority = ( pxCRCB )->uxPriority; …
74 …InsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ ( pxCRCB )->uxPriority ] ), &( ( pxCRCB )->xGene…
79 * automatically upon the creation of the first co-routine.
84 * Co-routines that are readied by an interrupt cannot be placed directly into
87 * list by the co-routine scheduler.
92 * Macro that looks at the list of co-routines that are currently delayed to
95 * Co-routines are stored in the queue in the order of their wake time -
96 * meaning once one co-routine has been found whose timer has not expired
101 /*-----------------------------------------------------------*/
110 /* Allocate the memory that will store the co-routine control block. */ in xCoRoutineCreate()
115 /* If pxCurrentCoRoutine is NULL then this is the first co-routine to in xCoRoutineCreate()
116 * be created and the co-routine data structures need initialising. */ in xCoRoutineCreate()
123 /* Check the priority is within limits. */ in xCoRoutineCreate()
126 uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1; in xCoRoutineCreate()
129 /* Fill out the co-routine control block from the function parameters. */ in xCoRoutineCreate()
130 pxCoRoutine->uxState = corINITIAL_STATE; in xCoRoutineCreate()
131 pxCoRoutine->uxPriority = uxPriority; in xCoRoutineCreate()
132 pxCoRoutine->uxIndex = uxIndex; in xCoRoutineCreate()
133 pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode; in xCoRoutineCreate()
135 /* Initialise all the other co-routine control block parameters. */ in xCoRoutineCreate()
136 vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) ); in xCoRoutineCreate()
137 vListInitialiseItem( &( pxCoRoutine->xEventListItem ) ); in xCoRoutineCreate()
139 /* Set the co-routine control block as a link back from the ListItem_t. in xCoRoutineCreate()
142 listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine ); in xCoRoutineCreate()
143 listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine ); in xCoRoutineCreate()
146 …listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_P… in xCoRoutineCreate()
148 /* Now the co-routine has been initialised it can be added to the ready in xCoRoutineCreate()
161 /*-----------------------------------------------------------*/
168 /* Calculate the time to wake - this may overflow but this is in vCoRoutineAddToDelayedList()
175 ( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); in vCoRoutineAddToDelayedList()
178 listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake ); in vCoRoutineAddToDelayedList()
184 …t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); in vCoRoutineAddToDelayedList()
190 … ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); in vCoRoutineAddToDelayedList()
195 /* Also add the co-routine to an event list. If this is done then the in vCoRoutineAddToDelayedList()
197 vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) ); in vCoRoutineAddToDelayedList()
200 /*-----------------------------------------------------------*/
204 /* Are there any co-routines waiting to get moved to the ready list? These in prvCheckPendingReadyList()
205 * are co-routines that have been readied by an ISR. The ISR cannot access in prvCheckPendingReadyList()
215 ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) ); in prvCheckPendingReadyList()
219 ( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) ); in prvCheckPendingReadyList()
223 /*-----------------------------------------------------------*/
229 xPassedTicks = xTaskGetTickCount() - xLastTickCount; in prvCheckDelayedList()
234 xPassedTicks--; in prvCheckDelayedList()
253 if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) ) in prvCheckDelayedList()
266 ( void ) uxListRemove( &( pxCRCB->xGenericListItem ) ); in prvCheckDelayedList()
268 /* Is the co-routine waiting on an event also? */ in prvCheckDelayedList()
269 if( pxCRCB->xEventListItem.pxContainer ) in prvCheckDelayedList()
271 ( void ) uxListRemove( &( pxCRCB->xEventListItem ) ); in prvCheckDelayedList()
282 /*-----------------------------------------------------------*/
286 /* Only run a co-routine after prvInitialiseCoRoutineLists() has been in vCoRoutineSchedule()
288 * co-routine is created. */ in vCoRoutineSchedule()
291 /* See if any co-routines readied by events need moving to the ready lists. */ in vCoRoutineSchedule()
294 /* See if any delayed co-routines have timed out. */ in vCoRoutineSchedule()
297 /* Find the highest priority queue that contains ready co-routines. */ in vCoRoutineSchedule()
302 /* No more co-routines to check. */ in vCoRoutineSchedule()
306 --uxTopCoRoutineReadyPriority; in vCoRoutineSchedule()
309 /* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines in vCoRoutineSchedule()
313 /* Call the co-routine. */ in vCoRoutineSchedule()
314 … ( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex ); in vCoRoutineSchedule()
317 /*-----------------------------------------------------------*/
337 /*-----------------------------------------------------------*/
346 * check has already been made to ensure pxEventList is not empty. */ in xCoRoutineRemoveFromEventList()
348 ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) ); in xCoRoutineRemoveFromEventList()
349 …vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem )… in xCoRoutineRemoveFromEventList()
351 if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority ) in xCoRoutineRemoveFromEventList()