*/\r
\r
/*\r
- * This demo file demonstrates how to send data between an ISR and a \r
+ * This demo file demonstrates how to send data between an ISR and a\r
* co-routine. A tick hook function is used to periodically pass data between\r
* the RTOS tick and a set of 'hook' co-routines.\r
*\r
* to wait for a character to be received on a queue from the tick ISR, checks\r
* to ensure the character received was that expected, then sends the number\r
* back to the tick ISR on a different queue.\r
- * \r
- * The tick ISR checks the numbers received back from the 'hook' co-routines \r
+ *\r
+ * The tick ISR checks the numbers received back from the 'hook' co-routines\r
* matches the number previously sent.\r
*\r
* If at any time a queue function returns unexpectedly, or an incorrect value\r
- * is received either by the tick hook or a co-routine then an error is \r
+ * is received either by the tick hook or a co-routine then an error is\r
* latched.\r
*\r
- * This demo relies on each 'hook' co-routine to execute between each \r
- * hookTICK_CALLS_BEFORE_POST tick interrupts. This and the heavy use of \r
- * queues from within an interrupt may result in an error being detected on \r
+ * This demo relies on each 'hook' co-routine to execute between each\r
+ * hookTICK_CALLS_BEFORE_POST tick interrupts. This and the heavy use of\r
+ * queues from within an interrupt may result in an error being detected on\r
* slower targets simply due to timing.\r
*/\r
\r
/* The number of 'hook' co-routines that are to be created. */\r
#define hookNUM_HOOK_CO_ROUTINES ( 4 )\r
\r
-/* The number of times the tick hook should be called before a character is \r
+/* The number of times the tick hook should be called before a character is\r
posted to the 'hook' co-routines. */\r
#define hookTICK_CALLS_BEFORE_POST ( 500 )\r
\r
\r
/*\r
* The tick hook function. This receives a number from each 'hook' co-routine\r
- * then sends a number to each co-routine. An error is flagged if a send or \r
+ * then sends a number to each co-routine. An error is flagged if a send or\r
* receive fails, or an unexpected number is received.\r
*/\r
void vApplicationTickHook( void );\r
\r
for( uxIndex = 0; uxIndex < hookNUM_HOOK_CO_ROUTINES; uxIndex++ )\r
{\r
- /* Create a queue to transmit to and receive from each 'hook' \r
+ /* Create a queue to transmit to and receive from each 'hook'\r
co-routine. */\r
xHookRxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) );\r
xHookTxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) );\r
\r
- /* To start things off the tick hook function expects the queue it \r
+ /* To start things off the tick hook function expects the queue it\r
uses to receive data to contain a value. */\r
xQueueSend( xHookRxQueues[ uxIndex ], &uxValueToPost, hookNO_BLOCK_TIME );\r
\r
xCoRoutineWoken = pdFALSE;\r
if( crQUEUE_RECEIVE_FROM_ISR( xHookRxQueues[ xIndex ], &uxReceivedNumber, &xCoRoutineWoken ) != pdPASS )\r
{\r
- /* There is no reason why we would not expect the queue to \r
+ /* There is no reason why we would not expect the queue to\r
contain a value. */\r
xCoRoutineErrorDetected = pdTRUE;\r
}\r
else\r
{\r
- /* Each queue used to receive data from the 'hook' co-routines \r
+ /* Each queue used to receive data from the 'hook' co-routines\r
should contain the number we last posted to the same co-routine. */\r
if( uxReceivedNumber != uxNumberToPost )\r
{\r
{\r
if( crQUEUE_SEND_FROM_ISR( xHookTxQueues[ xIndex ], &uxNumberToPost, pdFALSE ) != pdTRUE )\r
{\r
- /* Posting to the queue should have woken the co-routine that \r
+ /* Posting to the queue should have woken the co-routine that\r
was blocked on the queue. */\r
xCoRoutineErrorDetected = pdTRUE;\r
}\r
crQUEUE_SEND( xHandle, xHookRxQueues[ uxIndex ], &( uxReceivedValue[ uxIndex ] ), hookNO_BLOCK_TIME, &xResult );\r
if( xResult != pdPASS )\r
{\r
- /* There is no reason why we should not have been able to post to \r
+ /* There is no reason why we should not have been able to post to\r
the queue. */\r
xCoRoutineErrorDetected = pdTRUE;\r
}\r