77 #ifndef INC_FREERTOS_H
78 #error "include FreeRTOS.h must appear in source files before include croutine.h"
90 typedef void *CoRoutineHandle_t;
93 typedef void (*crCOROUTINE_CODE)(CoRoutineHandle_t,
UBaseType_t);
96 crCOROUTINE_CODE pxCoRoutineFunction;
218 void vCoRoutineSchedule(
void);
249 #define crSTART( pxCRCB ) switch( ( ( CRCB_t * )( pxCRCB ) )->uxState ) { case 0:
286 #define crSET_STATE0( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):
287 #define crSET_STATE1( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1):
335 #define crDELAY( xHandle, xTicksToDelay ) \
336 if( ( xTicksToDelay ) > 0 ) \
338 vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
340 crSET_STATE0( ( xHandle ) );
425 #define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
427 *( pxResult ) = xQueueCRSend( ( pxQueue) , ( pvItemToQueue) , ( xTicksToWait ) ); \
428 if( *( pxResult ) == errQUEUE_BLOCKED ) \
430 crSET_STATE0( ( xHandle ) ); \
431 *pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \
433 if( *pxResult == errQUEUE_YIELD ) \
435 crSET_STATE1( ( xHandle ) ); \
436 *pxResult = pdPASS; \
517 #define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
519 *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), ( xTicksToWait ) ); \
520 if( *( pxResult ) == errQUEUE_BLOCKED ) \
522 crSET_STATE0( ( xHandle ) ); \
523 *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), 0 ); \
525 if( *( pxResult ) == errQUEUE_YIELD ) \
527 crSET_STATE1( ( xHandle ) ); \
528 *( pxResult ) = pdPASS; \
626 #define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )
739 #define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )
750 void vCoRoutineAddToDelayedList(
TickType_t xTicksToDelay,
List_t *pxEventList);