croutine. h
);
void(* crCOROUTINE_CODE)(CoRoutineHandle_t xHandle, UBaseType_t uxIndex)
Definition croutine.h:50
BaseType_t xCoRoutineCreate(crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex)
long BaseType_t
Definition portmacro.h:59
unsigned long UBaseType_t
Definition portmacro.h:60
Create a new co-routine and add it to the list of co-routines that are ready to run.
- Parameters
-
pxCoRoutineCode | Pointer to the co-routine function. Co-routine functions require special syntax - see the co-routine section of the WEB documentation for more information. |
uxPriority | The priority with respect to other co-routines at which the co-routine will run. |
uxIndex | Used to distinguish between different co-routines that execute the same function. See the example below and the co-routine section of the WEB documentation for further information. |
- Returns
- pdPASS if the co-routine was successfully created and added to a ready list, otherwise an error code defined with ProjDefs.h.
Example usage:
{
static const char cLedToFlash[ 2 ] = { 5, 6 };
static const TickType_t uxFlashRates[ 2 ] = { 200, 400 };
for( ;; )
{
vParTestToggleLED( cLedToFlash[ uxIndex ] );
crDELAY( xHandle, uxFlashRates[ uxIndex ] );
}
}
void vOtherFunction( void )
{
uint8_t ucParameterToPass;
for( uxIndex = 0; uxIndex < 2; uxIndex++ )
{
}
}
#define crDELAY(xHandle, xTicksToDelay)
Definition croutine.h:310
#define crSTART(pxCRCB)
Definition croutine.h:214
void * CoRoutineHandle_t
Definition croutine.h:47
#define crEND()
Definition croutine.h:249
uint16_t TickType_t
Definition portmacro.h:63
struct tskTaskControlBlock * TaskHandle_t
Definition task.h:92