2 FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.
4 FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
5 http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
7 ***************************************************************************
9 * FreeRTOS tutorial books are available in pdf and paperback. *
10 * Complete, revised, and edited pdf reference manuals are also *
13 * Purchasing FreeRTOS documentation will not only help you, by *
14 * ensuring you get running as quickly as possible and with an *
15 * in-depth knowledge of how to use FreeRTOS, it will also help *
16 * the FreeRTOS project to continue with its mission of providing *
17 * professional grade, cross platform, de facto standard solutions *
18 * for microcontrollers - completely free of charge! *
20 * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
22 * Thank you for using FreeRTOS, and thank you for your support! *
24 ***************************************************************************
27 This file is part of the FreeRTOS distribution.
29 FreeRTOS is free software; you can redistribute it and/or modify it under
30 the terms of the GNU General Public License (version 2) as published by the
31 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
33 >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
34 distribute a combined work that includes FreeRTOS without being obliged to
35 provide the source code for proprietary components outside of the FreeRTOS
38 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
39 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
40 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
41 details. You should have received a copy of the GNU General Public License
42 and the FreeRTOS license exception along with FreeRTOS; if not it can be
43 viewed here: http://www.freertos.org/a00114.html and also obtained by
44 writing to Real Time Engineers Ltd., contact details for whom are available
45 on the FreeRTOS WEB site.
49 ***************************************************************************
51 * Having a problem? Start by reading the FAQ "My application does *
52 * not run, what could be wrong?" *
54 * http://www.FreeRTOS.org/FAQHelp.html *
56 ***************************************************************************
59 http://www.FreeRTOS.org - Documentation, books, training, latest versions,
60 license and Real Time Engineers Ltd. contact details.
62 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
63 including FreeRTOS+Trace - an indispensable productivity tool, and our new
64 fully thread aware and reentrant UDP/IP stack.
66 http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
67 Integrity Systems, who sell the code with commercial support,
68 indemnification and middleware, under the OpenRTOS brand.
70 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
71 engineered and independently SIL3 certified version for use in safety and
72 mission critical applications that require provable dependability.
79 #ifndef INC_FREERTOS_H
80 #error "include FreeRTOS.h" must appear in source files before "include queue.h"
88 #include "os/mpu_wrappers.h"
91 * Type by which queues are referenced. For example, a call to xQueueCreate()
92 * returns an xQueueHandle variable that can then be used as a parameter to
93 * xQueueSend(), xQueueReceive(), etc.
95 typedef void * xQueueHandle;
98 * Type by which queue sets are referenced. For example, a call to
99 * xQueueCreateSet() returns an xQueueSet variable that can then be used as a
100 * parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
102 typedef void * xQueueSetHandle;
105 * Queue sets can contain both queues and semaphores, so the
106 * xQueueSetMemberHandle is defined as a type to be used where a parameter or
107 * return value can be either an xQueueHandle or an xSemaphoreHandle.
109 typedef void * xQueueSetMemberHandle;
111 /* For internal use only. */
112 #define queueSEND_TO_BACK ( 0 )
113 #define queueSEND_TO_FRONT ( 1 )
115 /* For internal use only. These definitions *must* match those in queue.c. */
116 #define queueQUEUE_TYPE_BASE ( 0U )
117 #define queueQUEUE_TYPE_SET ( 0U )
118 #define queueQUEUE_TYPE_MUTEX ( 1U )
119 #define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( 2U )
120 #define queueQUEUE_TYPE_BINARY_SEMAPHORE ( 3U )
121 #define queueQUEUE_TYPE_RECURSIVE_MUTEX ( 4U )
126 xQueueHandle xQueueCreate(
127 unsigned portBASE_TYPE uxQueueLength,
128 unsigned portBASE_TYPE uxItemSize
132 * Creates a new queue instance. This allocates the storage required by the
133 * new queue and returns a handle for the queue.
135 * @param uxQueueLength The maximum number of items that the queue can contain.
137 * @param uxItemSize The number of bytes each item in the queue will require.
138 * Items are queued by copy, not by reference, so this is the number of bytes
139 * that will be copied for each posted item. Each item on the queue must be
142 * @return If the queue is successfully create then a handle to the newly
143 * created queue is returned. If the queue cannot be created then 0 is
154 void vATask( void *pvParameters )
156 xQueueHandle xQueue1, xQueue2;
158 // Create a queue capable of containing 10 unsigned long values.
159 xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
162 // Queue was not created and must not be used.
165 // Create a queue capable of containing 10 pointers to AMessage structures.
166 // These should be passed by pointer as they contain a lot of data.
167 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
170 // Queue was not created and must not be used.
173 // ... Rest of task code.
176 * \defgroup xQueueCreate xQueueCreate
177 * \ingroup QueueManagement
179 #define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( uxQueueLength, uxItemSize, queueQUEUE_TYPE_BASE )
184 portBASE_TYPE xQueueSendToToFront(
186 const void * pvItemToQueue,
187 portTickType xTicksToWait
191 * This is a macro that calls xQueueGenericSend().
193 * Post an item to the front of a queue. The item is queued by copy, not by
194 * reference. This function must not be called from an interrupt service
195 * routine. See xQueueSendFromISR () for an alternative which may be used
198 * @param xQueue The handle to the queue on which the item is to be posted.
200 * @param pvItemToQueue A pointer to the item that is to be placed on the
201 * queue. The size of the items the queue will hold was defined when the
202 * queue was created, so this many bytes will be copied from pvItemToQueue
203 * into the queue storage area.
205 * @param xTicksToWait The maximum amount of time the task should block
206 * waiting for space to become available on the queue, should it already
207 * be full. The call will return immediately if this is set to 0 and the
208 * queue is full. The time is defined in tick periods so the constant
209 * portTICK_RATE_MS should be used to convert to real time if this is required.
211 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
221 unsigned long ulVar = 10UL;
223 void vATask( void *pvParameters )
225 xQueueHandle xQueue1, xQueue2;
226 struct AMessage *pxMessage;
228 // Create a queue capable of containing 10 unsigned long values.
229 xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
231 // Create a queue capable of containing 10 pointers to AMessage structures.
232 // These should be passed by pointer as they contain a lot of data.
233 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
239 // Send an unsigned long. Wait for 10 ticks for space to become
240 // available if necessary.
241 if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )
243 // Failed to post the message, even after 10 ticks.
249 // Send a pointer to a struct AMessage object. Don't block if the
250 // queue is already full.
251 pxMessage = & xMessage;
252 xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );
255 // ... Rest of task code.
258 * \defgroup xQueueSend xQueueSend
259 * \ingroup QueueManagement
261 #define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
266 portBASE_TYPE xQueueSendToBack(
268 const void * pvItemToQueue,
269 portTickType xTicksToWait
273 * This is a macro that calls xQueueGenericSend().
275 * Post an item to the back of a queue. The item is queued by copy, not by
276 * reference. This function must not be called from an interrupt service
277 * routine. See xQueueSendFromISR () for an alternative which may be used
280 * @param xQueue The handle to the queue on which the item is to be posted.
282 * @param pvItemToQueue A pointer to the item that is to be placed on the
283 * queue. The size of the items the queue will hold was defined when the
284 * queue was created, so this many bytes will be copied from pvItemToQueue
285 * into the queue storage area.
287 * @param xTicksToWait The maximum amount of time the task should block
288 * waiting for space to become available on the queue, should it already
289 * be full. The call will return immediately if this is set to 0 and the queue
290 * is full. The time is defined in tick periods so the constant
291 * portTICK_RATE_MS should be used to convert to real time if this is required.
293 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
303 unsigned long ulVar = 10UL;
305 void vATask( void *pvParameters )
307 xQueueHandle xQueue1, xQueue2;
308 struct AMessage *pxMessage;
310 // Create a queue capable of containing 10 unsigned long values.
311 xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
313 // Create a queue capable of containing 10 pointers to AMessage structures.
314 // These should be passed by pointer as they contain a lot of data.
315 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
321 // Send an unsigned long. Wait for 10 ticks for space to become
322 // available if necessary.
323 if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )
325 // Failed to post the message, even after 10 ticks.
331 // Send a pointer to a struct AMessage object. Don't block if the
332 // queue is already full.
333 pxMessage = & xMessage;
334 xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );
337 // ... Rest of task code.
340 * \defgroup xQueueSend xQueueSend
341 * \ingroup QueueManagement
343 #define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
348 portBASE_TYPE xQueueSend(
350 const void * pvItemToQueue,
351 portTickType xTicksToWait
355 * This is a macro that calls xQueueGenericSend(). It is included for
356 * backward compatibility with versions of FreeRTOS.org that did not
357 * include the xQueueSendToFront() and xQueueSendToBack() macros. It is
358 * equivalent to xQueueSendToBack().
360 * Post an item on a queue. The item is queued by copy, not by reference.
361 * This function must not be called from an interrupt service routine.
362 * See xQueueSendFromISR () for an alternative which may be used in an ISR.
364 * @param xQueue The handle to the queue on which the item is to be posted.
366 * @param pvItemToQueue A pointer to the item that is to be placed on the
367 * queue. The size of the items the queue will hold was defined when the
368 * queue was created, so this many bytes will be copied from pvItemToQueue
369 * into the queue storage area.
371 * @param xTicksToWait The maximum amount of time the task should block
372 * waiting for space to become available on the queue, should it already
373 * be full. The call will return immediately if this is set to 0 and the
374 * queue is full. The time is defined in tick periods so the constant
375 * portTICK_RATE_MS should be used to convert to real time if this is required.
377 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
387 unsigned long ulVar = 10UL;
389 void vATask( void *pvParameters )
391 xQueueHandle xQueue1, xQueue2;
392 struct AMessage *pxMessage;
394 // Create a queue capable of containing 10 unsigned long values.
395 xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
397 // Create a queue capable of containing 10 pointers to AMessage structures.
398 // These should be passed by pointer as they contain a lot of data.
399 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
405 // Send an unsigned long. Wait for 10 ticks for space to become
406 // available if necessary.
407 if( xQueueSend( xQueue1, ( void * ) &ulVar, ( portTickType ) 10 ) != pdPASS )
409 // Failed to post the message, even after 10 ticks.
415 // Send a pointer to a struct AMessage object. Don't block if the
416 // queue is already full.
417 pxMessage = & xMessage;
418 xQueueSend( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0 );
421 // ... Rest of task code.
424 * \defgroup xQueueSend xQueueSend
425 * \ingroup QueueManagement
427 #define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
433 portBASE_TYPE xQueueGenericSend(
435 const void * pvItemToQueue,
436 portTickType xTicksToWait
437 portBASE_TYPE xCopyPosition
441 * It is preferred that the macros xQueueSend(), xQueueSendToFront() and
442 * xQueueSendToBack() are used in place of calling this function directly.
444 * Post an item on a queue. The item is queued by copy, not by reference.
445 * This function must not be called from an interrupt service routine.
446 * See xQueueSendFromISR () for an alternative which may be used in an ISR.
448 * @param xQueue The handle to the queue on which the item is to be posted.
450 * @param pvItemToQueue A pointer to the item that is to be placed on the
451 * queue. The size of the items the queue will hold was defined when the
452 * queue was created, so this many bytes will be copied from pvItemToQueue
453 * into the queue storage area.
455 * @param xTicksToWait The maximum amount of time the task should block
456 * waiting for space to become available on the queue, should it already
457 * be full. The call will return immediately if this is set to 0 and the
458 * queue is full. The time is defined in tick periods so the constant
459 * portTICK_RATE_MS should be used to convert to real time if this is required.
461 * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
462 * item at the back of the queue, or queueSEND_TO_FRONT to place the item
463 * at the front of the queue (for high priority messages).
465 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
475 unsigned long ulVar = 10UL;
477 void vATask( void *pvParameters )
479 xQueueHandle xQueue1, xQueue2;
480 struct AMessage *pxMessage;
482 // Create a queue capable of containing 10 unsigned long values.
483 xQueue1 = xQueueCreate( 10, sizeof( unsigned long ) );
485 // Create a queue capable of containing 10 pointers to AMessage structures.
486 // These should be passed by pointer as they contain a lot of data.
487 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
493 // Send an unsigned long. Wait for 10 ticks for space to become
494 // available if necessary.
495 if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( portTickType ) 10, queueSEND_TO_BACK ) != pdPASS )
497 // Failed to post the message, even after 10 ticks.
503 // Send a pointer to a struct AMessage object. Don't block if the
504 // queue is already full.
505 pxMessage = & xMessage;
506 xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( portTickType ) 0, queueSEND_TO_BACK );
509 // ... Rest of task code.
512 * \defgroup xQueueSend xQueueSend
513 * \ingroup QueueManagement
515 signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );
520 portBASE_TYPE xQueuePeek(
523 portTickType xTicksToWait
526 * This is a macro that calls the xQueueGenericReceive() function.
528 * Receive an item from a queue without removing the item from the queue.
529 * The item is received by copy so a buffer of adequate size must be
530 * provided. The number of bytes copied into the buffer was defined when
531 * the queue was created.
533 * Successfully received items remain on the queue so will be returned again
534 * by the next call, or a call to xQueueReceive().
536 * This macro must not be used in an interrupt service routine.
538 * @param xQueue The handle to the queue from which the item is to be
541 * @param pvBuffer Pointer to the buffer into which the received item will
544 * @param xTicksToWait The maximum amount of time the task should block
545 * waiting for an item to receive should the queue be empty at the time
546 * of the call. The time is defined in tick periods so the constant
547 * portTICK_RATE_MS should be used to convert to real time if this is required.
548 * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
551 * @return pdTRUE if an item was successfully received from the queue,
564 // Task to create a queue and post a value.
565 void vATask( void *pvParameters )
567 struct AMessage *pxMessage;
569 // Create a queue capable of containing 10 pointers to AMessage structures.
570 // These should be passed by pointer as they contain a lot of data.
571 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
574 // Failed to create the queue.
579 // Send a pointer to a struct AMessage object. Don't block if the
580 // queue is already full.
581 pxMessage = & xMessage;
582 xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );
584 // ... Rest of task code.
587 // Task to peek the data from the queue.
588 void vADifferentTask( void *pvParameters )
590 struct AMessage *pxRxedMessage;
594 // Peek a message on the created queue. Block for 10 ticks if a
595 // message is not immediately available.
596 if( xQueuePeek( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )
598 // pcRxedMessage now points to the struct AMessage variable posted
599 // by vATask, but the item still remains on the queue.
603 // ... Rest of task code.
606 * \defgroup xQueueReceive xQueueReceive
607 * \ingroup QueueManagement
609 #define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )
614 portBASE_TYPE xQueueReceive(
617 portTickType xTicksToWait
620 * This is a macro that calls the xQueueGenericReceive() function.
622 * Receive an item from a queue. The item is received by copy so a buffer of
623 * adequate size must be provided. The number of bytes copied into the buffer
624 * was defined when the queue was created.
626 * Successfully received items are removed from the queue.
628 * This function must not be used in an interrupt service routine. See
629 * xQueueReceiveFromISR for an alternative that can.
631 * @param xQueue The handle to the queue from which the item is to be
634 * @param pvBuffer Pointer to the buffer into which the received item will
637 * @param xTicksToWait The maximum amount of time the task should block
638 * waiting for an item to receive should the queue be empty at the time
639 * of the call. xQueueReceive() will return immediately if xTicksToWait
640 * is zero and the queue is empty. The time is defined in tick periods so the
641 * constant portTICK_RATE_MS should be used to convert to real time if this is
644 * @return pdTRUE if an item was successfully received from the queue,
657 // Task to create a queue and post a value.
658 void vATask( void *pvParameters )
660 struct AMessage *pxMessage;
662 // Create a queue capable of containing 10 pointers to AMessage structures.
663 // These should be passed by pointer as they contain a lot of data.
664 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
667 // Failed to create the queue.
672 // Send a pointer to a struct AMessage object. Don't block if the
673 // queue is already full.
674 pxMessage = & xMessage;
675 xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );
677 // ... Rest of task code.
680 // Task to receive from the queue.
681 void vADifferentTask( void *pvParameters )
683 struct AMessage *pxRxedMessage;
687 // Receive a message on the created queue. Block for 10 ticks if a
688 // message is not immediately available.
689 if( xQueueReceive( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )
691 // pcRxedMessage now points to the struct AMessage variable posted
696 // ... Rest of task code.
699 * \defgroup xQueueReceive xQueueReceive
700 * \ingroup QueueManagement
702 #define xQueueReceive( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )
708 portBASE_TYPE xQueueGenericReceive(
711 portTickType xTicksToWait
712 portBASE_TYPE xJustPeek
715 * It is preferred that the macro xQueueReceive() be used rather than calling
716 * this function directly.
718 * Receive an item from a queue. The item is received by copy so a buffer of
719 * adequate size must be provided. The number of bytes copied into the buffer
720 * was defined when the queue was created.
722 * This function must not be used in an interrupt service routine. See
723 * xQueueReceiveFromISR for an alternative that can.
725 * @param xQueue The handle to the queue from which the item is to be
728 * @param pvBuffer Pointer to the buffer into which the received item will
731 * @param xTicksToWait The maximum amount of time the task should block
732 * waiting for an item to receive should the queue be empty at the time
733 * of the call. The time is defined in tick periods so the constant
734 * portTICK_RATE_MS should be used to convert to real time if this is required.
735 * xQueueGenericReceive() will return immediately if the queue is empty and
738 * @param xJustPeek When set to true, the item received from the queue is not
739 * actually removed from the queue - meaning a subsequent call to
740 * xQueueReceive() will return the same item. When set to false, the item
741 * being received from the queue is also removed from the queue.
743 * @return pdTRUE if an item was successfully received from the queue,
756 // Task to create a queue and post a value.
757 void vATask( void *pvParameters )
759 struct AMessage *pxMessage;
761 // Create a queue capable of containing 10 pointers to AMessage structures.
762 // These should be passed by pointer as they contain a lot of data.
763 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
766 // Failed to create the queue.
771 // Send a pointer to a struct AMessage object. Don't block if the
772 // queue is already full.
773 pxMessage = & xMessage;
774 xQueueSend( xQueue, ( void * ) &pxMessage, ( portTickType ) 0 );
776 // ... Rest of task code.
779 // Task to receive from the queue.
780 void vADifferentTask( void *pvParameters )
782 struct AMessage *pxRxedMessage;
786 // Receive a message on the created queue. Block for 10 ticks if a
787 // message is not immediately available.
788 if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( portTickType ) 10 ) )
790 // pcRxedMessage now points to the struct AMessage variable posted
795 // ... Rest of task code.
798 * \defgroup xQueueReceive xQueueReceive
799 * \ingroup QueueManagement
801 signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek );
805 * <pre>unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle xQueue );</pre>
807 * Return the number of messages stored in a queue.
809 * @param xQueue A handle to the queue being queried.
811 * @return The number of messages available in the queue.
813 * \page uxQueueMessagesWaiting uxQueueMessagesWaiting
814 * \ingroup QueueManagement
816 unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle xQueue );
820 * <pre>void vQueueDelete( xQueueHandle xQueue );</pre>
822 * Delete a queue - freeing all the memory allocated for storing of items
823 * placed on the queue.
825 * @param xQueue A handle to the queue to be deleted.
827 * \page vQueueDelete vQueueDelete
828 * \ingroup QueueManagement
830 void vQueueDelete( xQueueHandle xQueue );
835 portBASE_TYPE xQueueSendToFrontFromISR(
837 const void *pvItemToQueue,
838 portBASE_TYPE *pxHigherPriorityTaskWoken
842 * This is a macro that calls xQueueGenericSendFromISR().
844 * Post an item to the front of a queue. It is safe to use this macro from
845 * within an interrupt service routine.
847 * Items are queued by copy not reference so it is preferable to only
848 * queue small items, especially when called from an ISR. In most cases
849 * it would be preferable to store a pointer to the item being queued.
851 * @param xQueue The handle to the queue on which the item is to be posted.
853 * @param pvItemToQueue A pointer to the item that is to be placed on the
854 * queue. The size of the items the queue will hold was defined when the
855 * queue was created, so this many bytes will be copied from pvItemToQueue
856 * into the queue storage area.
858 * @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
859 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
860 * to unblock, and the unblocked task has a priority higher than the currently
861 * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
862 * a context switch should be requested before the interrupt is exited.
864 * @return pdTRUE if the data was successfully sent to the queue, otherwise
867 * Example usage for buffered IO (where the ISR can obtain more than one value
870 void vBufferISR( void )
873 portBASE_TYPE xHigherPrioritTaskWoken;
875 // We have not woken a task at the start of the ISR.
876 xHigherPriorityTaskWoken = pdFALSE;
878 // Loop until the buffer is empty.
881 // Obtain a byte from the buffer.
882 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
885 xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
887 } while( portINPUT_BYTE( BUFFER_COUNT ) );
889 // Now the buffer is empty we can switch context if necessary.
890 if( xHigherPriorityTaskWoken )
897 * \defgroup xQueueSendFromISR xQueueSendFromISR
898 * \ingroup QueueManagement
900 #define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
906 portBASE_TYPE xQueueSendToBackFromISR(
908 const void *pvItemToQueue,
909 portBASE_TYPE *pxHigherPriorityTaskWoken
913 * This is a macro that calls xQueueGenericSendFromISR().
915 * Post an item to the back of a queue. It is safe to use this macro from
916 * within an interrupt service routine.
918 * Items are queued by copy not reference so it is preferable to only
919 * queue small items, especially when called from an ISR. In most cases
920 * it would be preferable to store a pointer to the item being queued.
922 * @param xQueue The handle to the queue on which the item is to be posted.
924 * @param pvItemToQueue A pointer to the item that is to be placed on the
925 * queue. The size of the items the queue will hold was defined when the
926 * queue was created, so this many bytes will be copied from pvItemToQueue
927 * into the queue storage area.
929 * @param pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set
930 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
931 * to unblock, and the unblocked task has a priority higher than the currently
932 * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then
933 * a context switch should be requested before the interrupt is exited.
935 * @return pdTRUE if the data was successfully sent to the queue, otherwise
938 * Example usage for buffered IO (where the ISR can obtain more than one value
941 void vBufferISR( void )
944 portBASE_TYPE xHigherPriorityTaskWoken;
946 // We have not woken a task at the start of the ISR.
947 xHigherPriorityTaskWoken = pdFALSE;
949 // Loop until the buffer is empty.
952 // Obtain a byte from the buffer.
953 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
956 xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
958 } while( portINPUT_BYTE( BUFFER_COUNT ) );
960 // Now the buffer is empty we can switch context if necessary.
961 if( xHigherPriorityTaskWoken )
968 * \defgroup xQueueSendFromISR xQueueSendFromISR
969 * \ingroup QueueManagement
971 #define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
976 portBASE_TYPE xQueueSendFromISR(
978 const void *pvItemToQueue,
979 portBASE_TYPE *pxHigherPriorityTaskWoken
983 * This is a macro that calls xQueueGenericSendFromISR(). It is included
984 * for backward compatibility with versions of FreeRTOS.org that did not
985 * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR()
988 * Post an item to the back of a queue. It is safe to use this function from
989 * within an interrupt service routine.
991 * Items are queued by copy not reference so it is preferable to only
992 * queue small items, especially when called from an ISR. In most cases
993 * it would be preferable to store a pointer to the item being queued.
995 * @param xQueue The handle to the queue on which the item is to be posted.
997 * @param pvItemToQueue A pointer to the item that is to be placed on the
998 * queue. The size of the items the queue will hold was defined when the
999 * queue was created, so this many bytes will be copied from pvItemToQueue
1000 * into the queue storage area.
1002 * @param pxHigherPriorityTaskWoken xQueueSendFromISR() will set
1003 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
1004 * to unblock, and the unblocked task has a priority higher than the currently
1005 * running task. If xQueueSendFromISR() sets this value to pdTRUE then
1006 * a context switch should be requested before the interrupt is exited.
1008 * @return pdTRUE if the data was successfully sent to the queue, otherwise
1011 * Example usage for buffered IO (where the ISR can obtain more than one value
1014 void vBufferISR( void )
1017 portBASE_TYPE xHigherPriorityTaskWoken;
1019 // We have not woken a task at the start of the ISR.
1020 xHigherPriorityTaskWoken = pdFALSE;
1022 // Loop until the buffer is empty.
1025 // Obtain a byte from the buffer.
1026 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
1029 xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
1031 } while( portINPUT_BYTE( BUFFER_COUNT ) );
1033 // Now the buffer is empty we can switch context if necessary.
1034 if( xHigherPriorityTaskWoken )
1036 // Actual macro used here is port specific.
1037 taskYIELD_FROM_ISR ();
1042 * \defgroup xQueueSendFromISR xQueueSendFromISR
1043 * \ingroup QueueManagement
1045 #define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
1050 portBASE_TYPE xQueueGenericSendFromISR(
1051 xQueueHandle xQueue,
1052 const void *pvItemToQueue,
1053 portBASE_TYPE *pxHigherPriorityTaskWoken,
1054 portBASE_TYPE xCopyPosition
1058 * It is preferred that the macros xQueueSendFromISR(),
1059 * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
1060 * of calling this function directly.
1062 * Post an item on a queue. It is safe to use this function from within an
1063 * interrupt service routine.
1065 * Items are queued by copy not reference so it is preferable to only
1066 * queue small items, especially when called from an ISR. In most cases
1067 * it would be preferable to store a pointer to the item being queued.
1069 * @param xQueue The handle to the queue on which the item is to be posted.
1071 * @param pvItemToQueue A pointer to the item that is to be placed on the
1072 * queue. The size of the items the queue will hold was defined when the
1073 * queue was created, so this many bytes will be copied from pvItemToQueue
1074 * into the queue storage area.
1076 * @param pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set
1077 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
1078 * to unblock, and the unblocked task has a priority higher than the currently
1079 * running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then
1080 * a context switch should be requested before the interrupt is exited.
1082 * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
1083 * item at the back of the queue, or queueSEND_TO_FRONT to place the item
1084 * at the front of the queue (for high priority messages).
1086 * @return pdTRUE if the data was successfully sent to the queue, otherwise
1089 * Example usage for buffered IO (where the ISR can obtain more than one value
1092 void vBufferISR( void )
1095 portBASE_TYPE xHigherPriorityTaskWokenByPost;
1097 // We have not woken a task at the start of the ISR.
1098 xHigherPriorityTaskWokenByPost = pdFALSE;
1100 // Loop until the buffer is empty.
1103 // Obtain a byte from the buffer.
1104 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
1107 xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK );
1109 } while( portINPUT_BYTE( BUFFER_COUNT ) );
1111 // Now the buffer is empty we can switch context if necessary. Note that the
1112 // name of the yield function required is port specific.
1113 if( xHigherPriorityTaskWokenByPost )
1115 taskYIELD_YIELD_FROM_ISR();
1120 * \defgroup xQueueSendFromISR xQueueSendFromISR
1121 * \ingroup QueueManagement
1123 signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition );
1128 portBASE_TYPE xQueueReceiveFromISR(
1129 xQueueHandle xQueue,
1131 portBASE_TYPE *pxTaskWoken
1135 * Receive an item from a queue. It is safe to use this function from within an
1136 * interrupt service routine.
1138 * @param xQueue The handle to the queue from which the item is to be
1141 * @param pvBuffer Pointer to the buffer into which the received item will
1144 * @param pxTaskWoken A task may be blocked waiting for space to become
1145 * available on the queue. If xQueueReceiveFromISR causes such a task to
1146 * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
1149 * @return pdTRUE if an item was successfully received from the queue,
1150 * otherwise pdFALSE.
1155 xQueueHandle xQueue;
1157 // Function to create a queue and post some values.
1158 void vAFunction( void *pvParameters )
1161 const portTickType xBlockTime = ( portTickType )0xff;
1163 // Create a queue capable of containing 10 characters.
1164 xQueue = xQueueCreate( 10, sizeof( char ) );
1167 // Failed to create the queue.
1172 // Post some characters that will be used within an ISR. If the queue
1173 // is full then this task will block for xBlockTime ticks.
1175 xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
1177 xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
1179 // ... keep posting characters ... this task may block when the queue
1183 xQueueSend( xQueue, ( void * ) &cValueToPost, xBlockTime );
1186 // ISR that outputs all the characters received on the queue.
1187 void vISR_Routine( void )
1189 portBASE_TYPE xTaskWokenByReceive = pdFALSE;
1192 while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
1194 // A character was received. Output the character now.
1195 vOutputCharacter( cRxedChar );
1197 // If removing the character from the queue woke the task that was
1198 // posting onto the queue cTaskWokenByReceive will have been set to
1199 // pdTRUE. No matter how many times this loop iterates only one
1200 // task will be woken.
1203 if( cTaskWokenByPost != ( char ) pdFALSE;
1209 * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
1210 * \ingroup QueueManagement
1212 signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken );
1215 * Utilities to query queues that are safe to use from an ISR. These utilities
1216 * should be used only from witin an ISR, or within a critical section.
1218 signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle xQueue );
1219 signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle xQueue );
1220 unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue );
1224 * xQueueAltGenericSend() is an alternative version of xQueueGenericSend().
1225 * Likewise xQueueAltGenericReceive() is an alternative version of
1226 * xQueueGenericReceive().
1228 * The source code that implements the alternative (Alt) API is much
1229 * simpler because it executes everything from within a critical section.
1230 * This is the approach taken by many other RTOSes, but FreeRTOS.org has the
1231 * preferred fully featured API too. The fully featured API has more
1232 * complex code that takes longer to execute, but makes much less use of
1233 * critical sections. Therefore the alternative API sacrifices interrupt
1234 * responsiveness to gain execution speed, whereas the fully featured API
1235 * sacrifices execution speed to ensure better interrupt responsiveness.
1237 signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );
1238 signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );
1239 #define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
1240 #define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
1241 #define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )
1242 #define xQueueAltPeek( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )
1245 * The functions defined above are for passing data to and from tasks. The
1246 * functions below are the equivalents for passing data to and from
1249 * These functions are called from the co-routine macro implementation and
1250 * should not be called directly from application code. Instead use the macro
1251 * wrappers defined within croutine.h.
1253 signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle xQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken );
1254 signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle xQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );
1255 signed portBASE_TYPE xQueueCRSend( xQueueHandle xQueue, const void *pvItemToQueue, portTickType xTicksToWait );
1256 signed portBASE_TYPE xQueueCRReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait );
1259 * For internal use only. Use xSemaphoreCreateMutex(),
1260 * xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
1261 * these functions directly.
1263 xQueueHandle xQueueCreateMutex( unsigned char ucQueueType );
1264 xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxCountValue, unsigned portBASE_TYPE uxInitialCount );
1265 void* xQueueGetMutexHolder( xQueueHandle xSemaphore );
1268 * For internal use only. Use xSemaphoreTakeMutexRecursive() or
1269 * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
1271 portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime );
1272 portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex );
1275 * Reset a queue back to its original empty state. pdPASS is returned if the
1276 * queue is successfully reset. pdFAIL is returned if the queue could not be
1277 * reset because there are tasks blocked on the queue waiting to either
1278 * receive from the queue or send to the queue.
1280 #define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
1283 * The registry is provided as a means for kernel aware debuggers to
1284 * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
1285 * a queue, semaphore or mutex handle to the registry if you want the handle
1286 * to be available to a kernel aware debugger. If you are not using a kernel
1287 * aware debugger then this function can be ignored.
1289 * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
1290 * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
1291 * within FreeRTOSConfig.h for the registry to be available. Its value
1292 * does not effect the number of queues, semaphores and mutexes that can be
1293 * created - just the number that the registry can hold.
1295 * @param xQueue The handle of the queue being added to the registry. This
1296 * is the handle returned by a call to xQueueCreate(). Semaphore and mutex
1297 * handles can also be passed in here.
1299 * @param pcName The name to be associated with the handle. This is the
1300 * name that the kernel aware debugger will display.
1302 #if configQUEUE_REGISTRY_SIZE > 0U
1303 void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName );
1307 * Generic version of the queue creation function, which is in turn called by
1308 * any queue, semaphore or mutex creation function or macro.
1310 xQueueHandle xQueueGenericCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize, unsigned char ucQueueType );
1313 * Queue sets provide a mechanism to allow a task to block (pend) on a read
1314 * operation from multiple queues or semaphores simultaneously.
1316 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
1319 * A queue set must be explicitly created using a call to xQueueCreateSet()
1320 * before it can be used. Once created, standard FreeRTOS queues and semaphores
1321 * can be added to the set using calls to xQueueAddToSet().
1322 * xQueueSelectFromSet() is then used to determine which, if any, of the queues
1323 * or semaphores contained in the set is in a state where a queue read or
1324 * semaphore take operation would be successful.
1326 * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
1327 * for reasons why queue sets are very rarely needed in practice as there are
1328 * simpler methods of blocking on multiple objects.
1330 * Note 2: Blocking on a queue set that contains a mutex will not cause the
1331 * mutex holder to inherit the priority of the blocked task.
1333 * Note 3: An additional 4 bytes of RAM is required for each space in a every
1334 * queue added to a queue set. Therefore counting semaphores that have a high
1335 * maximum count value should not be added to a queue set.
1337 * Note 4: A receive (in the case of a queue) or take (in the case of a
1338 * semaphore) operation must not be performed on a member of a queue set unless
1339 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
1341 * @param uxEventQueueLength Queue sets store events that occur on
1342 * the queues and semaphores contained in the set. uxEventQueueLength specifies
1343 * the maximum number of events that can be queued at once. To be absolutely
1344 * certain that events are not lost uxEventQueueLength should be set to the
1345 * total sum of the length of the queues added to the set, where binary
1346 * semaphores and mutexes have a length of 1, and counting semaphores have a
1347 * length set by their maximum count value. Examples:
1348 * + If a queue set is to hold a queue of length 5, another queue of length 12,
1349 * and a binary semaphore, then uxEventQueueLength should be set to
1350 * (5 + 12 + 1), or 18.
1351 * + If a queue set is to hold three binary semaphores then uxEventQueueLength
1352 * should be set to (1 + 1 + 1 ), or 3.
1353 * + If a queue set is to hold a counting semaphore that has a maximum count of
1354 * 5, and a counting semaphore that has a maximum count of 3, then
1355 * uxEventQueueLength should be set to (5 + 3), or 8.
1357 * @return If the queue set is created successfully then a handle to the created
1358 * queue set is returned. Otherwise NULL is returned.
1360 xQueueSetHandle xQueueCreateSet( unsigned portBASE_TYPE uxEventQueueLength );
1363 * Adds a queue or semaphore to a queue set that was previously created by a
1364 * call to xQueueCreateSet().
1366 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
1369 * Note 1: A receive (in the case of a queue) or take (in the case of a
1370 * semaphore) operation must not be performed on a member of a queue set unless
1371 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
1373 * @param xQueueOrSemaphore The handle of the queue or semaphore being added to
1374 * the queue set (cast to an xQueueSetMemberHandle type).
1376 * @param xQueueSet The handle of the queue set to which the queue or semaphore
1379 * @return If the queue or semaphore was successfully added to the queue set
1380 * then pdPASS is returned. If the queue could not be successfully added to the
1381 * queue set because it is already a member of a different queue set then pdFAIL
1384 portBASE_TYPE xQueueAddToSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet );
1387 * Removes a queue or semaphore from a queue set. A queue or semaphore can only
1388 * be removed from a set if the queue or semaphore is empty.
1390 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
1393 * @param xQueueOrSemaphore The handle of the queue or semaphore being removed
1394 * from the queue set (cast to an xQueueSetMemberHandle type).
1396 * @param xQueueSet The handle of the queue set in which the queue or semaphore
1399 * @return If the queue or semaphore was successfully removed from the queue set
1400 * then pdPASS is returned. If the queue was not in the queue set, or the
1401 * queue (or semaphore) was not empty, then pdFAIL is returned.
1403 portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet );
1406 * xQueueSelectFromSet() selects from the members of a queue set a queue or
1407 * semaphore that either contains data (in the case of a queue) or is available
1408 * to take (in the case of a semaphore). xQueueSelectFromSet() effectively
1409 * allows a task to block (pend) on a read operation on all the queues and
1410 * semaphores in a queue set simultaneously.
1412 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
1415 * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
1416 * for reasons why queue sets are very rarely needed in practice as there are
1417 * simpler methods of blocking on multiple objects.
1419 * Note 2: Blocking on a queue set that contains a mutex will not cause the
1420 * mutex holder to inherit the priority of the blocked task.
1422 * Note 3: A receive (in the case of a queue) or take (in the case of a
1423 * semaphore) operation must not be performed on a member of a queue set unless
1424 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
1426 * @param xQueueSet The queue set on which the task will (potentially) block.
1428 * @param xBlockTimeTicks The maximum time, in ticks, that the calling task will
1429 * remain in the Blocked state (with other tasks executing) to wait for a member
1430 * of the queue set to be ready for a successful queue read or semaphore take
1433 * @return xQueueSelectFromSet() will return the handle of a queue (cast to
1434 * a xQueueSetMemberHandle type) contained in the queue set that contains data,
1435 * or the handle of a semaphore (cast to a xQueueSetMemberHandle type) contained
1436 * in the queue set that is available, or NULL if no such queue or semaphore
1437 * exists before before the specified block time expires.
1439 xQueueSetMemberHandle xQueueSelectFromSet( xQueueSetHandle xQueueSet, portTickType xBlockTimeTicks );
1442 * A version of xQueueSelectFromSet() that can be used from an ISR.
1444 xQueueSetMemberHandle xQueueSelectFromSetFromISR( xQueueSetHandle xQueueSet );
1446 /* Not public API functions. */
1447 void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait );
1448 portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue );
1449 void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned char ucQueueNumber ) PRIVILEGED_FUNCTION;
1450 unsigned char ucQueueGetQueueType( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;
1457 #endif /* QUEUE_H */