X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=Source%2Fcroutine.c;h=61ada1c2918030a95655f7a42beb27ae6840c293;hb=6322b3a034f97d80ddf57699efd5a800569306ab;hp=15edabea3a62497ec181d62856c0895bc2323713;hpb=538727ec98136c0ab46ac467e2b42a8fbf7e5ba9;p=freertos diff --git a/Source/croutine.c b/Source/croutine.c index 15edabea3..61ada1c29 100644 --- a/Source/croutine.c +++ b/Source/croutine.c @@ -1,5 +1,5 @@ /* - FreeRTOS V6.0.3 - Copyright (C) 2010 Real Time Engineers Ltd. + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. *************************************************************************** * * @@ -10,7 +10,7 @@ * + Looking for basic training, * * + Wanting to improve your FreeRTOS skills and productivity * * * - * then take a look at the FreeRTOS eBook * + * then take a look at the FreeRTOS books - available as PDF or paperback * * * * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * * http://www.FreeRTOS.org/Documentation * @@ -222,7 +222,7 @@ static void prvCheckPendingReadyList( void ) /* Are there any co-routines waiting to get moved to the ready list? These are co-routines that have been readied by an ISR. The ISR cannot access the ready lists itself. */ - while( !listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) ) + while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE ) { corCRCB *pxUnblockedCRCB; @@ -263,8 +263,10 @@ corCRCB *pxCRCB; } /* See if this tick has made a timeout expire. */ - while( ( pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ) ) != NULL ) - { + while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE ) + { + pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ); + if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) ) { /* Timeout not yet expired. */ @@ -352,7 +354,8 @@ corCRCB *pxUnblockedCRCB; signed portBASE_TYPE xReturn; /* This function is called from within an interrupt. It can only access - event lists and the pending ready list. */ + event lists and the pending ready list. This function assumes that a + check has already been made to ensure pxEventList is not empty. */ pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList ); vListRemove( &( pxUnblockedCRCB->xEventListItem ) ); vListInsertEnd( ( xList * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );