Update some standard demo task implementations so they can be used with the cooperative scheduler.

This commit is contained in:
Richard Barry 2013-11-07 14:04:05 +00:00
parent 5aabe4f8fb
commit 40d2e74417
7 changed files with 105 additions and 43 deletions

View file

@ -1,5 +1,5 @@
/*
FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
@ -257,6 +257,11 @@ unsigned portBASE_TYPE uxOurPriority;
( *pulCounter )++;
}
vTaskPrioritySet( NULL, uxOurPriority );
#if( configUSE_PREEMPTION == 0 )
taskYIELD();
#endif
configASSERT( ( uxTaskPriorityGet( NULL ) == uxOurPriority ) );
}
}
@ -300,6 +305,10 @@ short sError = pdFALSE;
}
vTaskResume( xContinuousIncrementHandle );
#if( configUSE_PREEMPTION == 0 )
taskYIELD();
#endif
#if( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eReady );
@ -344,6 +353,10 @@ short sError = pdFALSE;
task has suspended itself with a known value in the counter variable. */
vTaskResume( xLimitedIncrementHandle );
#if( configUSE_PREEMPTION == 0 )
taskYIELD();
#endif
/* This task should not run again until xLimitedIncrementHandle has
suspended itself. */
#if( INCLUDE_eTaskGetState == 1 )
@ -368,6 +381,10 @@ short sError = pdFALSE;
/* Resume the continuous count task and do it all again. */
vTaskResume( xContinuousIncrementHandle );
#if( configUSE_PREEMPTION == 0 )
taskYIELD();
#endif
}
}
/*-----------------------------------------------------------*/