mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-11 13:54:16 -04:00
Update some standard demo task implementations so they can be used with the cooperative scheduler.
This commit is contained in:
parent
5aabe4f8fb
commit
40d2e74417
7 changed files with 105 additions and 43 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue