firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
croutine.h File Reference
#include "list.h"
Include dependency graph for croutine.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  corCoRoutineControlBlock

Macros

#define crSTART(pxCRCB)
#define crEND()
#define crSET_STATE0(xHandle)
#define crSET_STATE1(xHandle)
#define crDELAY(xHandle, xTicksToDelay)
#define crQUEUE_SEND(xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult)
#define crQUEUE_RECEIVE(xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult)
#define crQUEUE_SEND_FROM_ISR(pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken)
#define crQUEUE_RECEIVE_FROM_ISR(pxQueue, pvBuffer, pxCoRoutineWoken)

Typedefs

typedef void * CoRoutineHandle_t
typedef void(* crCOROUTINE_CODE) (CoRoutineHandle_t xHandle, UBaseType_t uxIndex)
typedef struct corCoRoutineControlBlock CRCB_t

Functions

BaseType_t xCoRoutineCreate (crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex)
void vCoRoutineSchedule (void)
void vCoRoutineAddToDelayedList (TickType_t xTicksToDelay, List_t *pxEventList)
BaseType_t xCoRoutineRemoveFromEventList (const List_t *pxEventList)
void vCoRoutineResetState (void) PRIVILEGED_FUNCTION

Macro Definition Documentation

◆ crDELAY

#define crDELAY ( xHandle,
xTicksToDelay )
Value:
do { \
if( ( xTicksToDelay ) > 0 ) \
{ \
vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
} \
crSET_STATE0( ( xHandle ) ); \
} while( 0 )

◆ crEND

#define crEND ( )
Value:
}

◆ crQUEUE_RECEIVE

#define crQUEUE_RECEIVE ( xHandle,
pxQueue,
pvBuffer,
xTicksToWait,
pxResult )
Value:
do { \
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
if( *( pxResult ) == errQUEUE_BLOCKED ) \
{ \
crSET_STATE0( ( xHandle ) ); \
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), 0 ); \
} \
if( *( pxResult ) == errQUEUE_YIELD ) \
{ \
crSET_STATE1( ( xHandle ) ); \
*( pxResult ) = pdPASS; \
} \
} while( 0 )
#define pdPASS
Definition projdefs.h:59
#define errQUEUE_YIELD
Definition projdefs.h:67
#define errQUEUE_BLOCKED
Definition projdefs.h:66

◆ crQUEUE_RECEIVE_FROM_ISR

#define crQUEUE_RECEIVE_FROM_ISR ( pxQueue,
pvBuffer,
pxCoRoutineWoken )
Value:
xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )

◆ crQUEUE_SEND

#define crQUEUE_SEND ( xHandle,
pxQueue,
pvItemToQueue,
xTicksToWait,
pxResult )
Value:
do { \
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
if( *( pxResult ) == errQUEUE_BLOCKED ) \
{ \
crSET_STATE0( ( xHandle ) ); \
*pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \
} \
if( *pxResult == errQUEUE_YIELD ) \
{ \
crSET_STATE1( ( xHandle ) ); \
*pxResult = pdPASS; \
} \
} while( 0 )

◆ crQUEUE_SEND_FROM_ISR

#define crQUEUE_SEND_FROM_ISR ( pxQueue,
pvItemToQueue,
xCoRoutinePreviouslyWoken )
Value:
xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )

◆ crSET_STATE0

#define crSET_STATE0 ( xHandle)
Value:
( ( CRCB_t * ) ( xHandle ) )->uxState = ( __LINE__ * 2 ); return; \
case ( __LINE__ * 2 ):
struct corCoRoutineControlBlock CRCB_t

◆ crSET_STATE1

#define crSET_STATE1 ( xHandle)
Value:
( ( CRCB_t * ) ( xHandle ) )->uxState = ( ( __LINE__ * 2 ) + 1 ); return; \
case ( ( __LINE__ * 2 ) + 1 ):

◆ crSTART

#define crSTART ( pxCRCB)
Value:
switch( ( ( CRCB_t * ) ( pxCRCB ) )->uxState ) { \
case 0:

Typedef Documentation

◆ CoRoutineHandle_t

typedef void* CoRoutineHandle_t

◆ CRCB_t

◆ crCOROUTINE_CODE

typedef void(* crCOROUTINE_CODE) (CoRoutineHandle_t xHandle, UBaseType_t uxIndex)

Function Documentation

◆ vCoRoutineAddToDelayedList()

void vCoRoutineAddToDelayedList ( TickType_t xTicksToDelay,
List_t * pxEventList )

◆ vCoRoutineResetState()

void vCoRoutineResetState ( void )

◆ vCoRoutineSchedule()

void vCoRoutineSchedule ( void )

◆ xCoRoutineCreate()

BaseType_t xCoRoutineCreate ( crCOROUTINE_CODE pxCoRoutineCode,
UBaseType_t uxPriority,
UBaseType_t uxIndex )

◆ xCoRoutineRemoveFromEventList()

BaseType_t xCoRoutineRemoveFromEventList ( const List_t * pxEventList)