]> git.sur5r.net Git - freertos/blob - Source/include/queue.h
Fixed name of xQueueSendToFrontFromISR.
[freertos] / Source / include / queue.h
1 /*\r
2         FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26         ***************************************************************************\r
27         See http://www.FreeRTOS.org for documentation, latest information, license\r
28         and contact details.  Please ensure to read the configuration and relevant\r
29         port sections of the online documentation.\r
30 \r
31         Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along\r
32         with commercial development and support options.\r
33         ***************************************************************************\r
34 */\r
35 \r
36 #ifndef QUEUE_H\r
37 #define QUEUE_H\r
38 \r
39 typedef void * xQueueHandle;\r
40 \r
41 /* For internal use only. */\r
42 #define queueSEND_TO_BACK       ( 0 )\r
43 #define queueSEND_TO_FRONT      ( 1 )\r
44 \r
45 \r
46 /**\r
47  * queue. h\r
48  * <pre>\r
49  xQueueHandle xQueueCreate(\r
50                               unsigned portBASE_TYPE uxQueueLength,\r
51                               unsigned portBASE_TYPE uxItemSize\r
52                           );\r
53  * </pre>\r
54  *\r
55  * Creates a new queue instance.  This allocates the storage required by the\r
56  * new queue and returns a handle for the queue.\r
57  *\r
58  * @param uxQueueLength The maximum number of items that the queue can contain.\r
59  *\r
60  * @param uxItemSize The number of bytes each item in the queue will require.\r
61  * Items are queued by copy, not by reference, so this is the number of bytes\r
62  * that will be copied for each posted item.  Each item on the queue must be\r
63  * the same size.\r
64  *\r
65  * @return If the queue is successfully create then a handle to the newly\r
66  * created queue is returned.  If the queue cannot be created then 0 is\r
67  * returned.\r
68  *\r
69  * Example usage:\r
70    <pre>\r
71  struct AMessage\r
72  {\r
73     portCHAR ucMessageID;\r
74     portCHAR ucData[ 20 ];\r
75  };\r
76 \r
77  void vATask( void *pvParameters )\r
78  {\r
79  xQueueHandle xQueue1, xQueue2;\r
80 \r
81     // Create a queue capable of containing 10 unsigned long values.\r
82     xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );\r
83     if( xQueue1 == 0 )\r
84     {\r
85         // Queue was not created and must not be used.\r
86     }\r
87 \r
88     // Create a queue capable of containing 10 pointers to AMessage structures.\r
89     // These should be passed by pointer as they contain a lot of data.\r
90     xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
91     if( xQueue2 == 0 )\r
92     {\r
93         // Queue was not created and must not be used.\r
94     }\r
95 \r
96     // ... Rest of task code.\r
97  }\r
98  </pre>\r
99  * \defgroup xQueueCreate xQueueCreate\r
100  * \ingroup QueueManagement\r
101  */\r
102 xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize );\r
103 \r
104 /**\r
105  * queue. h\r
106  * <pre>\r
107  portBASE_TYPE xQueueSendToToFront(\r
108                                    xQueueHandle xQueue,\r
109                                    const void * pvItemToQueue,\r
110                                    portTickType xTicksToWait\r
111                                );\r
112  * </pre>\r
113  *\r
114  * This is a macro that calls xQueueGenericSend().\r
115  *\r
116  * Post an item to the front of a queue.  The item is queued by copy, not by\r
117  * reference.  This function must not be called from an interrupt service\r
118  * routine.  See xQueueSendFromISR () for an alternative which may be used\r
119  * in an ISR.\r
120  *\r
121  * @param xQueue The handle to the queue on which the item is to be posted.\r
122  *\r
123  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
124  * queue.  The size of the items the queue will hold was defined when the\r
125  * queue was created, so this many bytes will be copied from pvItemToQueue\r
126  * into the queue storage area.\r
127  *\r
128  * @param xTicksToWait The maximum amount of time the task should block\r
129  * waiting for space to become available on the queue, should it already\r
130  * be full.  The call will return immediately if this is set to 0.  The\r
131  * time is defined in tick periods so the constant portTICK_RATE_MS\r
132  * should be used to convert to real time if this is required.\r
133  *\r
134  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
135  *\r
136  * Example usage:\r
137    <pre>\r
138  struct AMessage\r
139  {\r
140     portCHAR ucMessageID;\r
141     portCHAR ucData[ 20 ];\r
142  } xMessage;\r
143 \r
144  unsigned portLONG ulVar = 10UL;\r
145 \r
146  void vATask( void *pvParameters )\r
147  {\r
148  xQueueHandle xQueue1, xQueue2;\r
149  struct AMessage *pxMessage;\r
150 \r
151     // Create a queue capable of containing 10 unsigned long values.\r
152     xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );\r
153 \r
154     // Create a queue capable of containing 10 pointers to AMessage structures.\r
155     // These should be passed by pointer as they contain a lot of data.\r
156     xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
157 \r
158     // ...\r
159 \r
160     if( xQueue1 != 0 )\r
161     {\r
162         // Send an unsigned long.  Wait for 10 ticks for space to become\r
163         // available if necessary.\r
164         if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )\r
165         {\r
166             // Failed to post the message, even after 10 ticks.\r
167         }\r
168     }\r
169 \r
170     if( xQueue2 != 0 )\r
171     {\r
172         // Send a pointer to a struct AMessage object.  Don't block if the\r
173         // queue is already full.\r
174         pxMessage = & xMessage;\r
175         xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );\r
176     }\r
177 \r
178         // ... Rest of task code.\r
179  }\r
180  </pre>\r
181  * \defgroup xQueueSend xQueueSend\r
182  * \ingroup QueueManagement\r
183  */\r
184 #define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( xQueue, pvItemToQueue, xTicksToWait, queueSEND_TO_FRONT )\r
185 \r
186 /**\r
187  * queue. h\r
188  * <pre>\r
189  portBASE_TYPE xQueueSendToBack(\r
190                                    xQueueHandle xQueue,\r
191                                    const void * pvItemToQueue,\r
192                                    portTickType xTicksToWait\r
193                                );\r
194  * </pre>\r
195  *\r
196  * This is a macro that calls xQueueGenericSend().\r
197  *\r
198  * Post an item to the back of a queue.  The item is queued by copy, not by\r
199  * reference.  This function must not be called from an interrupt service\r
200  * routine.  See xQueueSendFromISR () for an alternative which may be used\r
201  * in an ISR.\r
202  *\r
203  * @param xQueue The handle to the queue on which the item is to be posted.\r
204  *\r
205  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
206  * queue.  The size of the items the queue will hold was defined when the\r
207  * queue was created, so this many bytes will be copied from pvItemToQueue\r
208  * into the queue storage area.\r
209  *\r
210  * @param xTicksToWait The maximum amount of time the task should block\r
211  * waiting for space to become available on the queue, should it already\r
212  * be full.  The call will return immediately if this is set to 0.  The\r
213  * time is defined in tick periods so the constant portTICK_RATE_MS\r
214  * should be used to convert to real time if this is required.\r
215  *\r
216  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
217  *\r
218  * Example usage:\r
219    <pre>\r
220  struct AMessage\r
221  {\r
222     portCHAR ucMessageID;\r
223     portCHAR ucData[ 20 ];\r
224  } xMessage;\r
225 \r
226  unsigned portLONG ulVar = 10UL;\r
227 \r
228  void vATask( void *pvParameters )\r
229  {\r
230  xQueueHandle xQueue1, xQueue2;\r
231  struct AMessage *pxMessage;\r
232 \r
233     // Create a queue capable of containing 10 unsigned long values.\r
234     xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );\r
235 \r
236     // Create a queue capable of containing 10 pointers to AMessage structures.\r
237     // These should be passed by pointer as they contain a lot of data.\r
238     xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
239 \r
240     // ...\r
241 \r
242     if( xQueue1 != 0 )\r
243     {\r
244         // Send an unsigned long.  Wait for 10 ticks for space to become\r
245         // available if necessary.\r
246         if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )\r
247         {\r
248             // Failed to post the message, even after 10 ticks.\r
249         }\r
250     }\r
251 \r
252     if( xQueue2 != 0 )\r
253     {\r
254         // Send a pointer to a struct AMessage object.  Don't block if the\r
255         // queue is already full.\r
256         pxMessage = & xMessage;\r
257         xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );\r
258     }\r
259 \r
260         // ... Rest of task code.\r
261  }\r
262  </pre>\r
263  * \defgroup xQueueSend xQueueSend\r
264  * \ingroup QueueManagement\r
265  */\r
266 #define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( xQueue, pvItemToQueue, xTicksToWait, queueSEND_TO_BACK )\r
267 \r
268 /**\r
269  * queue. h\r
270  * <pre>\r
271  portBASE_TYPE xQueueSend(\r
272                               xQueueHandle xQueue,\r
273                               const void * pvItemToQueue,\r
274                               portTickType xTicksToWait\r
275                          );\r
276  * </pre>\r
277  *\r
278  * This is a macro that calls xQueueGenericSend().  It is included for\r
279  * backward compatibility with versions of FreeRTOS.org that did not\r
280  * include the xQueueSendToFront() and xQueueSendToBack() macros.  It is\r
281  * equivalent to xQueueSendToBack().\r
282  *\r
283  * Post an item on a queue.  The item is queued by copy, not by reference.\r
284  * This function must not be called from an interrupt service routine.\r
285  * See xQueueSendFromISR () for an alternative which may be used in an ISR.\r
286  *\r
287  * @param xQueue The handle to the queue on which the item is to be posted.\r
288  *\r
289  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
290  * queue.  The size of the items the queue will hold was defined when the\r
291  * queue was created, so this many bytes will be copied from pvItemToQueue\r
292  * into the queue storage area.\r
293  *\r
294  * @param xTicksToWait The maximum amount of time the task should block\r
295  * waiting for space to become available on the queue, should it already\r
296  * be full.  The call will return immediately if this is set to 0.  The\r
297  * time is defined in tick periods so the constant portTICK_RATE_MS\r
298  * should be used to convert to real time if this is required.\r
299  *\r
300  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
301  *\r
302  * Example usage:\r
303    <pre>\r
304  struct AMessage\r
305  {\r
306     portCHAR ucMessageID;\r
307     portCHAR ucData[ 20 ];\r
308  } xMessage;\r
309 \r
310  unsigned portLONG ulVar = 10UL;\r
311 \r
312  void vATask( void *pvParameters )\r
313  {\r
314  xQueueHandle xQueue1, xQueue2;\r
315  struct AMessage *pxMessage;\r
316 \r
317     // Create a queue capable of containing 10 unsigned long values.\r
318     xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );\r
319 \r
320     // Create a queue capable of containing 10 pointers to AMessage structures.\r
321     // These should be passed by pointer as they contain a lot of data.\r
322     xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
323 \r
324     // ...\r
325 \r
326     if( xQueue1 != 0 )\r
327     {\r
328         // Send an unsigned long.  Wait for 10 ticks for space to become\r
329         // available if necessary.\r
330         if( xQueueSend( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )\r
331         {\r
332             // Failed to post the message, even after 10 ticks.\r
333         }\r
334     }\r
335 \r
336     if( xQueue2 != 0 )\r
337     {\r
338         // Send a pointer to a struct AMessage object.  Don't block if the\r
339         // queue is already full.\r
340         pxMessage = & xMessage;\r
341         xQueueSend( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );\r
342     }\r
343 \r
344         // ... Rest of task code.\r
345  }\r
346  </pre>\r
347  * \defgroup xQueueSend xQueueSend\r
348  * \ingroup QueueManagement\r
349  */\r
350 #define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( xQueue, pvItemToQueue, xTicksToWait, queueSEND_TO_BACK )\r
351 \r
352 \r
353 /**\r
354  * queue. h\r
355  * <pre>\r
356  portBASE_TYPE xQueueGenericSend(\r
357                                                                         xQueueHandle xQueue,\r
358                                                                         const void * pvItemToQueue,\r
359                                                                         portTickType xTicksToWait\r
360                                                                         portBASE_TYPE xCopyPosition\r
361                                                                 );\r
362  * </pre>\r
363  *\r
364  * It is preferred that the macros xQueueSend(), xQueueSendToFront() and\r
365  * xQueueSendToBack() are used in place of calling this function directly.\r
366  *\r
367  * Post an item on a queue.  The item is queued by copy, not by reference.\r
368  * This function must not be called from an interrupt service routine.\r
369  * See xQueueSendFromISR () for an alternative which may be used in an ISR.\r
370  *\r
371  * @param xQueue The handle to the queue on which the item is to be posted.\r
372  *\r
373  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
374  * queue.  The size of the items the queue will hold was defined when the\r
375  * queue was created, so this many bytes will be copied from pvItemToQueue\r
376  * into the queue storage area.\r
377  *\r
378  * @param xTicksToWait The maximum amount of time the task should block\r
379  * waiting for space to become available on the queue, should it already\r
380  * be full.  The call will return immediately if this is set to 0.  The\r
381  * time is defined in tick periods so the constant portTICK_RATE_MS\r
382  * should be used to convert to real time if this is required.\r
383  *\r
384  * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the\r
385  * item at the back of the queue, or queueSEND_TO_FRONT to place the item\r
386  * at the front of the queue (for high priority messages).\r
387  *\r
388  * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.\r
389  *\r
390  * Example usage:\r
391    <pre>\r
392  struct AMessage\r
393  {\r
394     portCHAR ucMessageID;\r
395     portCHAR ucData[ 20 ];\r
396  } xMessage;\r
397 \r
398  unsigned portLONG ulVar = 10UL;\r
399 \r
400  void vATask( void *pvParameters )\r
401  {\r
402  xQueueHandle xQueue1, xQueue2;\r
403  struct AMessage *pxMessage;\r
404 \r
405     // Create a queue capable of containing 10 unsigned long values.\r
406     xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );\r
407 \r
408     // Create a queue capable of containing 10 pointers to AMessage structures.\r
409     // These should be passed by pointer as they contain a lot of data.\r
410     xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
411 \r
412     // ...\r
413 \r
414     if( xQueue1 != 0 )\r
415     {\r
416         // Send an unsigned long.  Wait for 10 ticks for space to become\r
417         // available if necessary.\r
418         if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( portTickType ) 10, queueSEND_TO_BACK ) != pdPASS )\r
419         {\r
420             // Failed to post the message, even after 10 ticks.\r
421         }\r
422     }\r
423 \r
424     if( xQueue2 != 0 )\r
425     {\r
426         // Send a pointer to a struct AMessage object.  Don't block if the\r
427         // queue is already full.\r
428         pxMessage = & xMessage;\r
429         xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0, queueSEND_TO_BACK );\r
430     }\r
431 \r
432         // ... Rest of task code.\r
433  }\r
434  </pre>\r
435  * \defgroup xQueueSend xQueueSend\r
436  * \ingroup QueueManagement\r
437  */\r
438 signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portTickType xCopyPosition );\r
439 \r
440 /**\r
441  * queue. h\r
442  * <pre>\r
443  portBASE_TYPE xQueuePeek(\r
444                              xQueueHandle xQueue,\r
445                              void *pvBuffer,\r
446                              portTickType xTicksToWait\r
447                          );</pre>\r
448  *\r
449  * This is a macro that calls the xQueueGenericReceive() function.\r
450  *\r
451  * Receive an item from a queue without removing the item from the queue.\r
452  * The item is received by copy so a buffer of adequate size must be\r
453  * provided.  The number of bytes copied into the buffer was defined when\r
454  * the queue was created.\r
455  *\r
456  * Successfully received items remain on the queue so will be returned again\r
457  * by the next call, or a call to xQueueReceive().\r
458  *\r
459  * This macro must not be used in an interrupt service routine.\r
460  *\r
461  * @param pxQueue The handle to the queue from which the item is to be\r
462  * received.\r
463  *\r
464  * @param pvBuffer Pointer to the buffer into which the received item will\r
465  * be copied.\r
466  *\r
467  * @param xTicksToWait The maximum amount of time the task should block\r
468  * waiting for an item to receive should the queue be empty at the time\r
469  * of the call.    The time is defined in tick periods so the constant\r
470  * portTICK_RATE_MS should be used to convert to real time if this is required.\r
471  *\r
472  * @return pdTRUE if an item was successfully received from the queue,\r
473  * otherwise pdFALSE.\r
474  *\r
475  * Example usage:\r
476    <pre>\r
477  struct AMessage\r
478  {\r
479     portCHAR ucMessageID;\r
480     portCHAR ucData[ 20 ];\r
481  } xMessage;\r
482 \r
483  xQueueHandle xQueue;\r
484 \r
485  // Task to create a queue and post a value.\r
486  void vATask( void *pvParameters )\r
487  {\r
488  struct AMessage *pxMessage;\r
489 \r
490     // Create a queue capable of containing 10 pointers to AMessage structures.\r
491     // These should be passed by pointer as they contain a lot of data.\r
492     xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
493     if( xQueue == 0 )\r
494     {\r
495         // Failed to create the queue.\r
496     }\r
497 \r
498     // ...\r
499 \r
500     // Send a pointer to a struct AMessage object.  Don't block if the\r
501     // queue is already full.\r
502     pxMessage = & xMessage;\r
503     xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );\r
504 \r
505         // ... Rest of task code.\r
506  }\r
507 \r
508  // Task to peek the data from the queue.\r
509  void vADifferentTask( void *pvParameters )\r
510  {\r
511  struct AMessage *pxRxedMessage;\r
512 \r
513     if( xQueue != 0 )\r
514     {\r
515         // Peek a message on the created queue.  Block for 10 ticks if a\r
516         // message is not immediately available.\r
517         if( xQueuePeek( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )\r
518         {\r
519             // pcRxedMessage now points to the struct AMessage variable posted\r
520             // by vATask, but the item still remains on the queue.\r
521         }\r
522     }\r
523 \r
524         // ... Rest of task code.\r
525  }\r
526  </pre>\r
527  * \defgroup xQueueReceive xQueueReceive\r
528  * \ingroup QueueManagement\r
529  */\r
530 #define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( xQueue, pvBuffer, xTicksToWait, pdTRUE )\r
531 \r
532 /**\r
533  * queue. h\r
534  * <pre>\r
535  portBASE_TYPE xQueueReceive(\r
536                                  xQueueHandle xQueue,\r
537                                  void *pvBuffer,\r
538                                  portTickType xTicksToWait\r
539                             );</pre>\r
540  *\r
541  * This is a macro that calls the xQueueGenericReceive() function.\r
542  *\r
543  * Receive an item from a queue.  The item is received by copy so a buffer of\r
544  * adequate size must be provided.  The number of bytes copied into the buffer\r
545  * was defined when the queue was created.\r
546  *\r
547  * Successfully received items are removed from the queue.\r
548  *\r
549  * This function must not be used in an interrupt service routine.  See\r
550  * xQueueReceiveFromISR for an alternative that can.\r
551  *\r
552  * @param pxQueue The handle to the queue from which the item is to be\r
553  * received.\r
554  *\r
555  * @param pvBuffer Pointer to the buffer into which the received item will\r
556  * be copied.\r
557  *\r
558  * @param xTicksToWait The maximum amount of time the task should block\r
559  * waiting for an item to receive should the queue be empty at the time\r
560  * of the call.    The time is defined in tick periods so the constant\r
561  * portTICK_RATE_MS should be used to convert to real time if this is required.\r
562  *\r
563  * @return pdTRUE if an item was successfully received from the queue,\r
564  * otherwise pdFALSE.\r
565  *\r
566  * Example usage:\r
567    <pre>\r
568  struct AMessage\r
569  {\r
570     portCHAR ucMessageID;\r
571     portCHAR ucData[ 20 ];\r
572  } xMessage;\r
573 \r
574  xQueueHandle xQueue;\r
575 \r
576  // Task to create a queue and post a value.\r
577  void vATask( void *pvParameters )\r
578  {\r
579  struct AMessage *pxMessage;\r
580 \r
581     // Create a queue capable of containing 10 pointers to AMessage structures.\r
582     // These should be passed by pointer as they contain a lot of data.\r
583     xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
584     if( xQueue == 0 )\r
585     {\r
586         // Failed to create the queue.\r
587     }\r
588 \r
589     // ...\r
590 \r
591     // Send a pointer to a struct AMessage object.  Don't block if the\r
592     // queue is already full.\r
593     pxMessage = & xMessage;\r
594     xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );\r
595 \r
596         // ... Rest of task code.\r
597  }\r
598 \r
599  // Task to receive from the queue.\r
600  void vADifferentTask( void *pvParameters )\r
601  {\r
602  struct AMessage *pxRxedMessage;\r
603 \r
604     if( xQueue != 0 )\r
605     {\r
606         // Receive a message on the created queue.  Block for 10 ticks if a\r
607         // message is not immediately available.\r
608         if( xQueueReceive( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )\r
609         {\r
610             // pcRxedMessage now points to the struct AMessage variable posted\r
611             // by vATask.\r
612         }\r
613     }\r
614 \r
615         // ... Rest of task code.\r
616  }\r
617  </pre>\r
618  * \defgroup xQueueReceive xQueueReceive\r
619  * \ingroup QueueManagement\r
620  */\r
621 #define xQueueReceive( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( xQueue, pvBuffer, xTicksToWait, pdFALSE )\r
622 \r
623 \r
624 /**\r
625  * queue. h\r
626  * <pre>\r
627  portBASE_TYPE xQueueGenericReceive(\r
628                                        xQueueHandle xQueue,\r
629                                        void *pvBuffer,\r
630                                        portTickType xTicksToWait\r
631                                        portBASE_TYPE xJustPeek\r
632                                     );</pre>\r
633  *\r
634  * It is preferred that the macro xQueueReceive() be used rather than calling\r
635  * this function directly.\r
636  *\r
637  * Receive an item from a queue.  The item is received by copy so a buffer of\r
638  * adequate size must be provided.  The number of bytes copied into the buffer\r
639  * was defined when the queue was created.\r
640  *\r
641  * This function must not be used in an interrupt service routine.  See\r
642  * xQueueReceiveFromISR for an alternative that can.\r
643  *\r
644  * @param pxQueue The handle to the queue from which the item is to be\r
645  * received.\r
646  *\r
647  * @param pvBuffer Pointer to the buffer into which the received item will\r
648  * be copied.\r
649  *\r
650  * @param xTicksToWait The maximum amount of time the task should block\r
651  * waiting for an item to receive should the queue be empty at the time\r
652  * of the call.    The time is defined in tick periods so the constant\r
653  * portTICK_RATE_MS should be used to convert to real time if this is required.\r
654  *\r
655  * @param xJustPeek When set to true, the item received from the queue is not\r
656  * actually removed from the queue - meaning a subsequent call to\r
657  * xQueueReceive() will return the same item.  When set to false, the item\r
658  * being received from the queue is also removed from the queue.\r
659  *\r
660  * @return pdTRUE if an item was successfully received from the queue,\r
661  * otherwise pdFALSE.\r
662  *\r
663  * Example usage:\r
664    <pre>\r
665  struct AMessage\r
666  {\r
667     portCHAR ucMessageID;\r
668     portCHAR ucData[ 20 ];\r
669  } xMessage;\r
670 \r
671  xQueueHandle xQueue;\r
672 \r
673  // Task to create a queue and post a value.\r
674  void vATask( void *pvParameters )\r
675  {\r
676  struct AMessage *pxMessage;\r
677 \r
678     // Create a queue capable of containing 10 pointers to AMessage structures.\r
679     // These should be passed by pointer as they contain a lot of data.\r
680     xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );\r
681     if( xQueue == 0 )\r
682     {\r
683         // Failed to create the queue.\r
684     }\r
685 \r
686     // ...\r
687 \r
688     // Send a pointer to a struct AMessage object.  Don't block if the\r
689     // queue is already full.\r
690     pxMessage = & xMessage;\r
691     xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );\r
692 \r
693         // ... Rest of task code.\r
694  }\r
695 \r
696  // Task to receive from the queue.\r
697  void vADifferentTask( void *pvParameters )\r
698  {\r
699  struct AMessage *pxRxedMessage;\r
700 \r
701     if( xQueue != 0 )\r
702     {\r
703         // Receive a message on the created queue.  Block for 10 ticks if a\r
704         // message is not immediately available.\r
705         if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )\r
706         {\r
707             // pcRxedMessage now points to the struct AMessage variable posted\r
708             // by vATask.\r
709         }\r
710     }\r
711 \r
712         // ... Rest of task code.\r
713  }\r
714  </pre>\r
715  * \defgroup xQueueReceive xQueueReceive\r
716  * \ingroup QueueManagement\r
717  */\r
718 signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek );\r
719 \r
720 /**\r
721  * queue. h\r
722  * <pre>unsigned portBASE_TYPE uxQueueMessagesWaiting( xQueueHandle xQueue );</pre>\r
723  *\r
724  * Return the number of messages stored in a queue.\r
725  *\r
726  * @param xQueue A handle to the queue being queried.\r
727  *\r
728  * @return The number of messages available in the queue.\r
729  *\r
730  * \page uxQueueMessagesWaiting uxQueueMessagesWaiting\r
731  * \ingroup QueueManagement\r
732  */\r
733 unsigned portBASE_TYPE uxQueueMessagesWaiting( xQueueHandle xQueue );\r
734 \r
735 /**\r
736  * queue. h\r
737  * <pre>void vQueueDelete( xQueueHandle xQueue );</pre>\r
738  *\r
739  * Delete a queue - freeing all the memory allocated for storing of items\r
740  * placed on the queue.\r
741  *\r
742  * @param xQueue A handle to the queue to be deleted.\r
743  *\r
744  * \page vQueueDelete vQueueDelete\r
745  * \ingroup QueueManagement\r
746  */\r
747 void vQueueDelete( xQueueHandle xQueue );\r
748 \r
749 /**\r
750  * queue. h\r
751  * <pre>\r
752  portBASE_TYPE xQueueSendToFrontFromISR(\r
753                                          xQueueHandle pxQueue,\r
754                                          const void *pvItemToQueue,\r
755                                          portBASE_TYPE xTaskPreviouslyWoken\r
756                                       );\r
757  </pre>\r
758  *\r
759  * This is a macro that calls xQueueGenericSendFromISR().\r
760  *\r
761  * Post an item to the front of a queue.  It is safe to use this macro from\r
762  * within an interrupt service routine.\r
763  *\r
764  * Items are queued by copy not reference so it is preferable to only\r
765  * queue small items, especially when called from an ISR.  In most cases\r
766  * it would be preferable to store a pointer to the item being queued.\r
767  *\r
768  * @param xQueue The handle to the queue on which the item is to be posted.\r
769  *\r
770  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
771  * queue.  The size of the items the queue will hold was defined when the\r
772  * queue was created, so this many bytes will be copied from pvItemToQueue\r
773  * into the queue storage area.\r
774  *\r
775  * @param cTaskPreviouslyWoken This is included so an ISR can post onto\r
776  * the same queue multiple times from a single interrupt.  The first call\r
777  * should always pass in pdFALSE.  Subsequent calls should pass in\r
778  * the value returned from the previous call.  See the file serial .c in the\r
779  * PC port for a good example of this mechanism.\r
780  *\r
781  * @return pdTRUE if a task was woken by posting onto the queue.  This is\r
782  * used by the ISR to determine if a context switch may be required following\r
783  * the ISR.\r
784  *\r
785  * Example usage for buffered IO (where the ISR can obtain more than one value\r
786  * per call):\r
787    <pre>\r
788  void vBufferISR( void )\r
789  {\r
790  portCHAR cIn;\r
791  portBASE_TYPE xTaskWokenByPost;\r
792 \r
793     // We have not woken a task at the start of the ISR.\r
794     cTaskWokenByPost = pdFALSE;\r
795 \r
796     // Loop until the buffer is empty.\r
797     do\r
798     {\r
799         // Obtain a byte from the buffer.\r
800         cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );                                            \r
801 \r
802         // Post the byte.  The first time round the loop cTaskWokenByPost\r
803         // will be pdFALSE.  If the queue send causes a task to wake we do\r
804         // not want the task to run until we have finished the ISR, so\r
805         // xQueueSendFromISR does not cause a context switch.  Also we\r
806         // don't want subsequent posts to wake any other tasks, so we store\r
807         // the return value back into cTaskWokenByPost so xQueueSendFromISR\r
808         // knows not to wake any task the next iteration of the loop.\r
809         xTaskWokenByPost = xQueueSendToFrontFromISR( xRxQueue, &cIn, cTaskWokenByPost );\r
810 \r
811     } while( portINPUT_BYTE( BUFFER_COUNT ) );\r
812 \r
813     // Now the buffer is empty we can switch context if necessary.\r
814     if( cTaskWokenByPost )\r
815     {\r
816         taskYIELD ();\r
817     }\r
818  }\r
819  </pre>\r
820  *\r
821  * \defgroup xQueueSendFromISR xQueueSendFromISR\r
822  * \ingroup QueueManagement\r
823  */\r
824 #define xQueueSendToFrontFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken ) xQueueGenericSendFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken, queueSEND_TO_FRONT )\r
825 \r
826 \r
827 /**\r
828  * queue. h\r
829  * <pre>\r
830  portBASE_TYPE xQueueSendToBackFromISR(\r
831                                          xQueueHandle pxQueue,\r
832                                          const void *pvItemToQueue,\r
833                                          portBASE_TYPE xTaskPreviouslyWoken\r
834                                       );\r
835  </pre>\r
836  *\r
837  * This is a macro that calls xQueueGenericSendFromISR().\r
838  *\r
839  * Post an item to the back of a queue.  It is safe to use this macro from\r
840  * within an interrupt service routine.\r
841  *\r
842  * Items are queued by copy not reference so it is preferable to only\r
843  * queue small items, especially when called from an ISR.  In most cases\r
844  * it would be preferable to store a pointer to the item being queued.\r
845  *\r
846  * @param xQueue The handle to the queue on which the item is to be posted.\r
847  *\r
848  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
849  * queue.  The size of the items the queue will hold was defined when the\r
850  * queue was created, so this many bytes will be copied from pvItemToQueue\r
851  * into the queue storage area.\r
852  *\r
853  * @param cTaskPreviouslyWoken This is included so an ISR can post onto\r
854  * the same queue multiple times from a single interrupt.  The first call\r
855  * should always pass in pdFALSE.  Subsequent calls should pass in\r
856  * the value returned from the previous call.  See the file serial .c in the\r
857  * PC port for a good example of this mechanism.\r
858  *\r
859  * @return pdTRUE if a task was woken by posting onto the queue.  This is\r
860  * used by the ISR to determine if a context switch may be required following\r
861  * the ISR.\r
862  *\r
863  * Example usage for buffered IO (where the ISR can obtain more than one value\r
864  * per call):\r
865    <pre>\r
866  void vBufferISR( void )\r
867  {\r
868  portCHAR cIn;\r
869  portBASE_TYPE xTaskWokenByPost;\r
870 \r
871     // We have not woken a task at the start of the ISR.\r
872     cTaskWokenByPost = pdFALSE;\r
873 \r
874     // Loop until the buffer is empty.\r
875     do\r
876     {\r
877         // Obtain a byte from the buffer.\r
878         cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );                                            \r
879 \r
880         // Post the byte.  The first time round the loop cTaskWokenByPost\r
881         // will be pdFALSE.  If the queue send causes a task to wake we do\r
882         // not want the task to run until we have finished the ISR, so\r
883         // xQueueSendFromISR does not cause a context switch.  Also we\r
884         // don't want subsequent posts to wake any other tasks, so we store\r
885         // the return value back into cTaskWokenByPost so xQueueSendFromISR\r
886         // knows not to wake any task the next iteration of the loop.\r
887         xTaskWokenByPost = xQueueSendToBackFromISR( xRxQueue, &cIn, cTaskWokenByPost );\r
888 \r
889     } while( portINPUT_BYTE( BUFFER_COUNT ) );\r
890 \r
891     // Now the buffer is empty we can switch context if necessary.\r
892     if( cTaskWokenByPost )\r
893     {\r
894         taskYIELD ();\r
895     }\r
896  }\r
897  </pre>\r
898  *\r
899  * \defgroup xQueueSendFromISR xQueueSendFromISR\r
900  * \ingroup QueueManagement\r
901  */\r
902 #define xQueueSendToBackFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken ) xQueueGenericSendFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken, queueSEND_TO_BACK )\r
903 \r
904 \r
905 /**\r
906  * queue. h\r
907  * <pre>\r
908  portBASE_TYPE xQueueSendFromISR(\r
909                                      xQueueHandle pxQueue,\r
910                                      const void *pvItemToQueue,\r
911                                      portBASE_TYPE xTaskPreviouslyWoken\r
912                                 );\r
913  </pre>\r
914  *\r
915  * This is a macro that calls xQueueGenericSendFromISR().  It is included\r
916  * for backward compatibility with versions of FreeRTOS.org that did not\r
917  * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR()\r
918  * macros.\r
919  *\r
920  * Post an item to the back of a queue.  It is safe to use this function from\r
921  * within an interrupt service routine.\r
922  *\r
923  * Items are queued by copy not reference so it is preferable to only\r
924  * queue small items, especially when called from an ISR.  In most cases\r
925  * it would be preferable to store a pointer to the item being queued.\r
926  *\r
927  * @param xQueue The handle to the queue on which the item is to be posted.\r
928  *\r
929  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
930  * queue.  The size of the items the queue will hold was defined when the\r
931  * queue was created, so this many bytes will be copied from pvItemToQueue\r
932  * into the queue storage area.\r
933  *\r
934  * @param cTaskPreviouslyWoken This is included so an ISR can post onto\r
935  * the same queue multiple times from a single interrupt.  The first call\r
936  * should always pass in pdFALSE.  Subsequent calls should pass in\r
937  * the value returned from the previous call.  See the file serial .c in the\r
938  * PC port for a good example of this mechanism.\r
939  *\r
940  * @return pdTRUE if a task was woken by posting onto the queue.  This is\r
941  * used by the ISR to determine if a context switch may be required following\r
942  * the ISR.\r
943  *\r
944  * Example usage for buffered IO (where the ISR can obtain more than one value\r
945  * per call):\r
946    <pre>\r
947  void vBufferISR( void )\r
948  {\r
949  portCHAR cIn;\r
950  portBASE_TYPE xTaskWokenByPost;\r
951 \r
952     // We have not woken a task at the start of the ISR.\r
953     cTaskWokenByPost = pdFALSE;\r
954 \r
955     // Loop until the buffer is empty.\r
956     do\r
957     {\r
958         // Obtain a byte from the buffer.\r
959         cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );                                            \r
960 \r
961         // Post the byte.  The first time round the loop cTaskWokenByPost\r
962         // will be pdFALSE.  If the queue send causes a task to wake we do\r
963         // not want the task to run until we have finished the ISR, so\r
964         // xQueueSendFromISR does not cause a context switch.  Also we\r
965         // don't want subsequent posts to wake any other tasks, so we store\r
966         // the return value back into cTaskWokenByPost so xQueueSendFromISR\r
967         // knows not to wake any task the next iteration of the loop.\r
968         xTaskWokenByPost = xQueueSendFromISR( xRxQueue, &cIn, cTaskWokenByPost );\r
969 \r
970     } while( portINPUT_BYTE( BUFFER_COUNT ) );\r
971 \r
972     // Now the buffer is empty we can switch context if necessary.\r
973     if( cTaskWokenByPost )\r
974     {\r
975         taskYIELD ();\r
976     }\r
977  }\r
978  </pre>\r
979  *\r
980  * \defgroup xQueueSendFromISR xQueueSendFromISR\r
981  * \ingroup QueueManagement\r
982  */\r
983 #define xQueueSendFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken ) xQueueGenericSendFromISR( pxQueue, pvItemToQueue, xTaskPreviouslyWoken, queueSEND_TO_BACK )\r
984 \r
985 /**\r
986  * queue. h\r
987  * <pre>\r
988  portBASE_TYPE xQueueGenericSendFromISR(\r
989                                            xQueueHandle pxQueue,\r
990                                            const void *pvItemToQueue,\r
991                                            portBASE_TYPE xTaskPreviouslyWoken\r
992                                                                                    portBASE_TYPE xCopyPosition\r
993                                        );\r
994  </pre>\r
995  *\r
996  * It is preferred that the macros xQueueSendFromISR(),\r
997  * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place\r
998  * of calling this function directly.\r
999  *\r
1000  * Post an item on a queue.  It is safe to use this function from within an\r
1001  * interrupt service routine.\r
1002  *\r
1003  * Items are queued by copy not reference so it is preferable to only\r
1004  * queue small items, especially when called from an ISR.  In most cases\r
1005  * it would be preferable to store a pointer to the item being queued.\r
1006  *\r
1007  * @param xQueue The handle to the queue on which the item is to be posted.\r
1008  *\r
1009  * @param pvItemToQueue A pointer to the item that is to be placed on the\r
1010  * queue.  The size of the items the queue will hold was defined when the\r
1011  * queue was created, so this many bytes will be copied from pvItemToQueue\r
1012  * into the queue storage area.\r
1013  *\r
1014  * @param cTaskPreviouslyWoken This is included so an ISR can post onto\r
1015  * the same queue multiple times from a single interrupt.  The first call\r
1016  * should always pass in pdFALSE.  Subsequent calls should pass in\r
1017  * the value returned from the previous call.  See the file serial .c in the\r
1018  * PC port for a good example of this mechanism.\r
1019  *\r
1020  * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the\r
1021  * item at the back of the queue, or queueSEND_TO_FRONT to place the item\r
1022  * at the front of the queue (for high priority messages).\r
1023  *\r
1024  * @return pdTRUE if a task was woken by posting onto the queue.  This is\r
1025  * used by the ISR to determine if a context switch may be required following\r
1026  * the ISR.\r
1027  *\r
1028  * Example usage for buffered IO (where the ISR can obtain more than one value\r
1029  * per call):\r
1030    <pre>\r
1031  void vBufferISR( void )\r
1032  {\r
1033  portCHAR cIn;\r
1034  portBASE_TYPE xTaskWokenByPost;\r
1035 \r
1036     // We have not woken a task at the start of the ISR.\r
1037     cTaskWokenByPost = pdFALSE;\r
1038 \r
1039     // Loop until the buffer is empty.\r
1040     do\r
1041     {\r
1042         // Obtain a byte from the buffer.\r
1043         cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );                                            \r
1044 \r
1045         // Post the byte.  The first time round the loop cTaskWokenByPost\r
1046         // will be pdFALSE.  If the queue send causes a task to wake we do\r
1047         // not want the task to run until we have finished the ISR, so\r
1048         // xQueueSendFromISR does not cause a context switch.  Also we\r
1049         // don't want subsequent posts to wake any other tasks, so we store\r
1050         // the return value back into cTaskWokenByPost so xQueueSendFromISR\r
1051         // knows not to wake any task the next iteration of the loop.\r
1052         xTaskWokenByPost = xQueueGenericSendFromISR( xRxQueue, &cIn, cTaskWokenByPost, queueSEND_TO_BACK );\r
1053 \r
1054     } while( portINPUT_BYTE( BUFFER_COUNT ) );\r
1055 \r
1056     // Now the buffer is empty we can switch context if necessary.\r
1057     if( cTaskWokenByPost )\r
1058     {\r
1059         taskYIELD ();\r
1060     }\r
1061  }\r
1062  </pre>\r
1063  *\r
1064  * \defgroup xQueueSendFromISR xQueueSendFromISR\r
1065  * \ingroup QueueManagement\r
1066  */\r
1067 signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken, portBASE_TYPE xCopyPosition );\r
1068 \r
1069 /**\r
1070  * queue. h\r
1071  * <pre>\r
1072  portBASE_TYPE xQueueReceiveFromISR(\r
1073                                        xQueueHandle pxQueue,\r
1074                                        void *pvBuffer,\r
1075                                        portBASE_TYPE *pxTaskWoken\r
1076                                    );\r
1077  * </pre>\r
1078  *\r
1079  * Receive an item from a queue.  It is safe to use this function from within an\r
1080  * interrupt service routine.\r
1081  *\r
1082  * @param pxQueue The handle to the queue from which the item is to be\r
1083  * received.\r
1084  *\r
1085  * @param pvBuffer Pointer to the buffer into which the received item will\r
1086  * be copied.\r
1087  *\r
1088  * @param pxTaskWoken A task may be blocked waiting for space to become\r
1089  * available on the queue.  If xQueueReceiveFromISR causes such a task to\r
1090  * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will\r
1091  * remain unchanged.\r
1092  *\r
1093  * @return pdTRUE if an item was successfully received from the queue,\r
1094  * otherwise pdFALSE.\r
1095  *\r
1096  * Example usage:\r
1097    <pre>\r
1098 \r
1099  xQueueHandle xQueue;\r
1100 \r
1101  // Function to create a queue and post some values.\r
1102  void vAFunction( void *pvParameters )\r
1103  {\r
1104  portCHAR cValueToPost;\r
1105  const portTickType xBlockTime = ( portTickType )0xff;\r
1106 \r
1107     // Create a queue capable of containing 10 characters.\r
1108     xQueue = xQueueCreate( 10, sizeof( portCHAR ) );\r
1109     if( xQueue == 0 )\r
1110     {\r
1111         // Failed to create the queue.\r
1112     }\r
1113 \r
1114     // ...\r
1115 \r
1116     // Post some characters that will be used within an ISR.  If the queue\r
1117     // is full then this task will block for xBlockTime ticks.\r
1118     cValueToPost = 'a';\r
1119     xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
1120     cValueToPost = 'b';\r
1121     xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
1122 \r
1123     // ... keep posting characters ... this task may block when the queue\r
1124     // becomes full.\r
1125 \r
1126     cValueToPost = 'c';\r
1127     xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );\r
1128  }\r
1129 \r
1130  // ISR that outputs all the characters received on the queue.\r
1131  void vISR_Routine( void )\r
1132  {\r
1133  portBASE_TYPE xTaskWokenByReceive = pdFALSE;\r
1134  portCHAR cRxedChar;\r
1135 \r
1136     while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )\r
1137     {\r
1138         // A character was received.  Output the character now.\r
1139         vOutputCharacter( cRxedChar );\r
1140 \r
1141         // If removing the character from the queue woke the task that was\r
1142         // posting onto the queue cTaskWokenByReceive will have been set to\r
1143         // pdTRUE.  No matter how many times this loop iterates only one\r
1144         // task will be woken.\r
1145     }\r
1146 \r
1147     if( cTaskWokenByPost != ( portCHAR ) pdFALSE;\r
1148     {\r
1149         taskYIELD ();\r
1150     }\r
1151  }\r
1152  </pre>\r
1153  * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR\r
1154  * \ingroup QueueManagement\r
1155  */\r
1156 signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxTaskWoken );\r
1157 \r
1158 \r
1159 /*\r
1160  * The functions defined above are for passing data to and from tasks.  The\r
1161  * functions below are the equivalents for passing data to and from\r
1162  * co-routines.\r
1163  *\r
1164  * These functions are called from the co-routine macro implementation and\r
1165  * should not be called directly from application code.  Instead use the macro\r
1166  * wrappers defined within croutine.h.\r
1167  */\r
1168 signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken );\r
1169 signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );\r
1170 signed portBASE_TYPE xQueueCRSend( xQueueHandle pxQueue, const void *pvItemToQueue, portTickType xTicksToWait );\r
1171 signed portBASE_TYPE xQueueCRReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait );\r
1172 \r
1173 /*\r
1174  * For internal use only.  Use xSemaphoreCreateMutex() instead of calling\r
1175  * this function directly.\r
1176  */\r
1177 xQueueHandle xQueueCreateMutex( void );\r
1178 \r
1179 #endif /* QUEUE_H */\r
1180 \r