/* Used to hide the implementation of the co-routine control block. The\r
control block structure however has to be included in the header due to\r
the macro implementation of the co-routine functionality. */\r
-typedef void * xCoRoutineHandle;\r
+typedef void * CoRoutineHandle_t;\r
\r
/* Defines the prototype to which co-routine functions must conform. */\r
-typedef void (*crCOROUTINE_CODE)( xCoRoutineHandle, unsigned portBASE_TYPE );\r
+typedef void (*crCOROUTINE_CODE)( CoRoutineHandle_t, unsigned portBASE_TYPE );\r
\r
typedef struct corCoRoutineControlBlock\r
{\r
unsigned portBASE_TYPE uxPriority; /*< The priority of the co-routine in relation to other co-routines. */\r
unsigned portBASE_TYPE uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */\r
unsigned short uxState; /*< Used internally by the co-routine implementation. */\r
-} corCRCB; /* Co-routine control block. Note must be identical in size down to uxPriority with tskTCB. */\r
+} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with tskTCB. */\r
\r
/**\r
* croutine. h\r
* Example usage:\r
<pre>\r
// Co-routine to be created.\r
- void vFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ void vFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
// This may not be necessary for const variables.\r
/**\r
* croutine. h\r
* <pre>\r
- crSTART( xCoRoutineHandle xHandle );</pre>\r
+ crSTART( CoRoutineHandle_t xHandle );</pre>\r
*\r
* This macro MUST always be called at the start of a co-routine function.\r
*\r
* Example usage:\r
<pre>\r
// Co-routine to be created.\r
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ void vACoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
static long ulAVariable;\r
* \defgroup crSTART crSTART\r
* \ingroup Tasks\r
*/\r
-#define crSTART( pxCRCB ) switch( ( ( corCRCB * )( pxCRCB ) )->uxState ) { case 0:\r
+#define crSTART( pxCRCB ) switch( ( ( CRCB_t * )( pxCRCB ) )->uxState ) { case 0:\r
\r
/**\r
* croutine. h\r
* Example usage:\r
<pre>\r
// Co-routine to be created.\r
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ void vACoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
static long ulAVariable;\r
* These macros are intended for internal use by the co-routine implementation\r
* only. The macros should not be used directly by application writers.\r
*/\r
-#define crSET_STATE0( xHandle ) ( ( corCRCB * )( xHandle ) )->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):\r
-#define crSET_STATE1( xHandle ) ( ( corCRCB * )( xHandle ) )->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1):\r
+#define crSET_STATE0( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):\r
+#define crSET_STATE1( xHandle ) ( ( CRCB_t * )( xHandle ) )->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1):\r
\r
/**\r
* croutine. h\r
*<pre>\r
- crDELAY( xCoRoutineHandle xHandle, portTickType xTicksToDelay );</pre>\r
+ crDELAY( CoRoutineHandle_t xHandle, portTickType xTicksToDelay );</pre>\r
*\r
* Delay a co-routine for a fixed period of time.\r
*\r
* Example usage:\r
<pre>\r
// Co-routine to be created.\r
- void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ void vACoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
// This may not be necessary for const variables.\r
/**\r
* <pre>\r
crQUEUE_SEND(\r
- xCoRoutineHandle xHandle,\r
+ CoRoutineHandle_t xHandle,\r
xQueueHandle pxQueue,\r
void *pvItemToQueue,\r
portTickType xTicksToWait,\r
<pre>\r
// Co-routine function that blocks for a fixed period then posts a number onto\r
// a queue.\r
- static void prvCoRoutineFlashTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ static void prvCoRoutineFlashTask( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
static portBASE_TYPE xNumberToPost = 0;\r
* croutine. h\r
* <pre>\r
crQUEUE_RECEIVE(\r
- xCoRoutineHandle xHandle,\r
+ CoRoutineHandle_t xHandle,\r
xQueueHandle pxQueue,\r
void *pvBuffer,\r
portTickType xTicksToWait,\r
<pre>\r
// A co-routine receives the number of an LED to flash from a queue. It\r
// blocks on the queue until the number is received.\r
- static void prvCoRoutineFlashWorkTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ static void prvCoRoutineFlashWorkTask( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// Variables in co-routines must be declared static if they must maintain value across a blocking call.\r
static portBASE_TYPE xResult;\r
* Example usage:\r
<pre>\r
// A co-routine that blocks on a queue waiting for characters to be received.\r
- static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ static void vReceivingCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
char cRxedChar;\r
portBASE_TYPE xResult;\r
<pre>\r
// A co-routine that posts a character to a queue then blocks for a fixed\r
// period. The character is incremented each time.\r
- static void vSendingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
+ static void vSendingCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
// cChar holds its value while this co-routine is blocked and must therefore\r
// be declared static.\r