33 #error "include FreeRTOS.h must appear in source files before include croutine.h"
214#define crSTART( pxCRCB ) \
215 switch( ( ( CRCB_t * ) ( pxCRCB ) )->uxState ) { \
255#define crSET_STATE0( xHandle ) \
256 ( ( CRCB_t * ) ( xHandle ) )->uxState = ( __LINE__ * 2 ); return; \
257 case ( __LINE__ * 2 ):
258#define crSET_STATE1( xHandle ) \
259 ( ( CRCB_t * ) ( xHandle ) )->uxState = ( ( __LINE__ * 2 ) + 1 ); return; \
260 case ( ( __LINE__ * 2 ) + 1 ):
310#define crDELAY( xHandle, xTicksToDelay ) \
312 if( ( xTicksToDelay ) > 0 ) \
314 vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
316 crSET_STATE0( ( xHandle ) ); \
404#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
406 *( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
407 if( *( pxResult ) == errQUEUE_BLOCKED ) \
409 crSET_STATE0( ( xHandle ) ); \
410 *pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \
412 if( *pxResult == errQUEUE_YIELD ) \
414 crSET_STATE1( ( xHandle ) ); \
415 *pxResult = pdPASS; \
498#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
500 *( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
501 if( *( pxResult ) == errQUEUE_BLOCKED ) \
503 crSET_STATE0( ( xHandle ) ); \
504 *( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), 0 ); \
506 if( *( pxResult ) == errQUEUE_YIELD ) \
508 crSET_STATE1( ( xHandle ) ); \
509 *( pxResult ) = pdPASS; \
609#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) \
610 xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )
725#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) \
726 xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )
struct corCoRoutineControlBlock CRCB_t
void * CoRoutineHandle_t
Definition croutine.h:47
void vCoRoutineSchedule(void)
void vCoRoutineAddToDelayedList(TickType_t xTicksToDelay, List_t *pxEventList)
void vCoRoutineResetState(void) PRIVILEGED_FUNCTION
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)
BaseType_t xCoRoutineRemoveFromEventList(const List_t *pxEventList)
struct xLIST_ITEM ListItem_t
Definition list.h:154
#define PRIVILEGED_FUNCTION
Definition mpu_wrappers.h:269
long BaseType_t
Definition portmacro.h:59
unsigned long UBaseType_t
Definition portmacro.h:60
uint16_t TickType_t
Definition portmacro.h:63
ListItem_t xEventListItem
Definition croutine.h:57
UBaseType_t uxIndex
Definition croutine.h:59
UBaseType_t uxPriority
Definition croutine.h:58
uint16_t uxState
Definition croutine.h:60
ListItem_t xGenericListItem
Definition croutine.h:56
crCOROUTINE_CODE pxCoRoutineFunction
Definition croutine.h:55