31 #ifndef INC_FREERTOS_H 32 #error "include FreeRTOS.h must appear in source files before include croutine.h" 44 typedef void * CoRoutineHandle_t;
47 typedef void (*crCOROUTINE_CODE)( CoRoutineHandle_t, UBaseType_t );
51 crCOROUTINE_CODE pxCoRoutineFunction;
54 UBaseType_t uxPriority;
131 BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex );
173 void vCoRoutineSchedule(
void );
204 #define crSTART( pxCRCB ) switch( ( ( CRCB_t * )( pxCRCB ) )->uxState ) { case 0: 241 #define crSET_STATE0( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = (__LINE__ * 2); return; case (__LINE__ * 2): 242 #define crSET_STATE1( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1): 290 #define crDELAY( xHandle, xTicksToDelay ) \ 291 if( ( xTicksToDelay ) > 0 ) \ 293 vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \ 295 crSET_STATE0( ( xHandle ) ); 380 #define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \ 382 *( pxResult ) = xQueueCRSend( ( pxQueue) , ( pvItemToQueue) , ( xTicksToWait ) ); \ 383 if( *( pxResult ) == errQUEUE_BLOCKED ) \ 385 crSET_STATE0( ( xHandle ) ); \ 386 *pxResult = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), 0 ); \ 388 if( *pxResult == errQUEUE_YIELD ) \ 390 crSET_STATE1( ( xHandle ) ); \ 391 *pxResult = pdPASS; \ 472 #define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \ 474 *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), ( xTicksToWait ) ); \ 475 if( *( pxResult ) == errQUEUE_BLOCKED ) \ 477 crSET_STATE0( ( xHandle ) ); \ 478 *( pxResult ) = xQueueCRReceive( ( pxQueue) , ( pvBuffer ), 0 ); \ 480 if( *( pxResult ) == errQUEUE_YIELD ) \ 482 crSET_STATE1( ( xHandle ) ); \ 483 *( pxResult ) = pdPASS; \ 581 #define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) ) 694 #define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) ) 705 void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
List_t *pxEventList );
714 BaseType_t xCoRoutineRemoveFromEventList(
const List_t *pxEventList );
Definition: croutine.h:49