David Fletcher / Mbed 2 deprecated cc3100_Test_websock_Camera_CM4F

Dependencies:   mbed

Committer:
dflet
Date:
Wed Jun 24 09:54:16 2015 +0000
Revision:
0:50cedd586816
First commit work in progress

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:50cedd586816 1 /*
dflet 0:50cedd586816 2 FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.
dflet 0:50cedd586816 3 All rights reserved
dflet 0:50cedd586816 4
dflet 0:50cedd586816 5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
dflet 0:50cedd586816 6
dflet 0:50cedd586816 7 This file is part of the FreeRTOS distribution.
dflet 0:50cedd586816 8
dflet 0:50cedd586816 9 FreeRTOS is free software; you can redistribute it and/or modify it under
dflet 0:50cedd586816 10 the terms of the GNU General Public License (version 2) as published by the
dflet 0:50cedd586816 11 Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
dflet 0:50cedd586816 12
dflet 0:50cedd586816 13 ***************************************************************************
dflet 0:50cedd586816 14 >>! NOTE: The modification to the GPL is included to allow you to !<<
dflet 0:50cedd586816 15 >>! distribute a combined work that includes FreeRTOS without being !<<
dflet 0:50cedd586816 16 >>! obliged to provide the source code for proprietary components !<<
dflet 0:50cedd586816 17 >>! outside of the FreeRTOS kernel. !<<
dflet 0:50cedd586816 18 ***************************************************************************
dflet 0:50cedd586816 19
dflet 0:50cedd586816 20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
dflet 0:50cedd586816 21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dflet 0:50cedd586816 22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
dflet 0:50cedd586816 23 link: http://www.freertos.org/a00114.html
dflet 0:50cedd586816 24
dflet 0:50cedd586816 25 ***************************************************************************
dflet 0:50cedd586816 26 * *
dflet 0:50cedd586816 27 * FreeRTOS provides completely free yet professionally developed, *
dflet 0:50cedd586816 28 * robust, strictly quality controlled, supported, and cross *
dflet 0:50cedd586816 29 * platform software that is more than just the market leader, it *
dflet 0:50cedd586816 30 * is the industry's de facto standard. *
dflet 0:50cedd586816 31 * *
dflet 0:50cedd586816 32 * Help yourself get started quickly while simultaneously helping *
dflet 0:50cedd586816 33 * to support the FreeRTOS project by purchasing a FreeRTOS *
dflet 0:50cedd586816 34 * tutorial book, reference manual, or both: *
dflet 0:50cedd586816 35 * http://www.FreeRTOS.org/Documentation *
dflet 0:50cedd586816 36 * *
dflet 0:50cedd586816 37 ***************************************************************************
dflet 0:50cedd586816 38
dflet 0:50cedd586816 39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
dflet 0:50cedd586816 40 the FAQ page "My application does not run, what could be wrong?". Have you
dflet 0:50cedd586816 41 defined configASSERT()?
dflet 0:50cedd586816 42
dflet 0:50cedd586816 43 http://www.FreeRTOS.org/support - In return for receiving this top quality
dflet 0:50cedd586816 44 embedded software for free we request you assist our global community by
dflet 0:50cedd586816 45 participating in the support forum.
dflet 0:50cedd586816 46
dflet 0:50cedd586816 47 http://www.FreeRTOS.org/training - Investing in training allows your team to
dflet 0:50cedd586816 48 be as productive as possible as early as possible. Now you can receive
dflet 0:50cedd586816 49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
dflet 0:50cedd586816 50 Ltd, and the world's leading authority on the world's leading RTOS.
dflet 0:50cedd586816 51
dflet 0:50cedd586816 52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
dflet 0:50cedd586816 53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
dflet 0:50cedd586816 54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
dflet 0:50cedd586816 55
dflet 0:50cedd586816 56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
dflet 0:50cedd586816 57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
dflet 0:50cedd586816 58
dflet 0:50cedd586816 59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
dflet 0:50cedd586816 60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
dflet 0:50cedd586816 61 licenses offer ticketed support, indemnification and commercial middleware.
dflet 0:50cedd586816 62
dflet 0:50cedd586816 63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
dflet 0:50cedd586816 64 engineered and independently SIL3 certified version for use in safety and
dflet 0:50cedd586816 65 mission critical applications that require provable dependability.
dflet 0:50cedd586816 66
dflet 0:50cedd586816 67 1 tab == 4 spaces!
dflet 0:50cedd586816 68 */
dflet 0:50cedd586816 69
dflet 0:50cedd586816 70
dflet 0:50cedd586816 71 #ifndef QUEUE_H
dflet 0:50cedd586816 72 #define QUEUE_H
dflet 0:50cedd586816 73
dflet 0:50cedd586816 74 #ifndef INC_FREERTOS_H
dflet 0:50cedd586816 75 #error "include FreeRTOS.h" must appear in source files before "include queue.h"
dflet 0:50cedd586816 76 #endif
dflet 0:50cedd586816 77
dflet 0:50cedd586816 78 #ifdef __cplusplus
dflet 0:50cedd586816 79 extern "C" {
dflet 0:50cedd586816 80 #endif
dflet 0:50cedd586816 81
dflet 0:50cedd586816 82
dflet 0:50cedd586816 83 /**
dflet 0:50cedd586816 84 * Type by which queues are referenced. For example, a call to xQueueCreate()
dflet 0:50cedd586816 85 * returns an QueueHandle_t variable that can then be used as a parameter to
dflet 0:50cedd586816 86 * xQueueSend(), xQueueReceive(), etc.
dflet 0:50cedd586816 87 */
dflet 0:50cedd586816 88 typedef void * QueueHandle_t;
dflet 0:50cedd586816 89
dflet 0:50cedd586816 90 /**
dflet 0:50cedd586816 91 * Type by which queue sets are referenced. For example, a call to
dflet 0:50cedd586816 92 * xQueueCreateSet() returns an xQueueSet variable that can then be used as a
dflet 0:50cedd586816 93 * parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
dflet 0:50cedd586816 94 */
dflet 0:50cedd586816 95 typedef void * QueueSetHandle_t;
dflet 0:50cedd586816 96
dflet 0:50cedd586816 97 /**
dflet 0:50cedd586816 98 * Queue sets can contain both queues and semaphores, so the
dflet 0:50cedd586816 99 * QueueSetMemberHandle_t is defined as a type to be used where a parameter or
dflet 0:50cedd586816 100 * return value can be either an QueueHandle_t or an SemaphoreHandle_t.
dflet 0:50cedd586816 101 */
dflet 0:50cedd586816 102 typedef void * QueueSetMemberHandle_t;
dflet 0:50cedd586816 103
dflet 0:50cedd586816 104 /* For internal use only. */
dflet 0:50cedd586816 105 #define queueSEND_TO_BACK ( ( BaseType_t ) 0 )
dflet 0:50cedd586816 106 #define queueSEND_TO_FRONT ( ( BaseType_t ) 1 )
dflet 0:50cedd586816 107 #define queueOVERWRITE ( ( BaseType_t ) 2 )
dflet 0:50cedd586816 108
dflet 0:50cedd586816 109 /* For internal use only. These definitions *must* match those in queue.c. */
dflet 0:50cedd586816 110 #define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U )
dflet 0:50cedd586816 111 #define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U )
dflet 0:50cedd586816 112 #define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U )
dflet 0:50cedd586816 113 #define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U )
dflet 0:50cedd586816 114 #define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U )
dflet 0:50cedd586816 115 #define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U )
dflet 0:50cedd586816 116
dflet 0:50cedd586816 117 /**
dflet 0:50cedd586816 118 * queue. h
dflet 0:50cedd586816 119 * <pre>
dflet 0:50cedd586816 120 QueueHandle_t xQueueCreate(
dflet 0:50cedd586816 121 UBaseType_t uxQueueLength,
dflet 0:50cedd586816 122 UBaseType_t uxItemSize
dflet 0:50cedd586816 123 );
dflet 0:50cedd586816 124 * </pre>
dflet 0:50cedd586816 125 *
dflet 0:50cedd586816 126 * Creates a new queue instance. This allocates the storage required by the
dflet 0:50cedd586816 127 * new queue and returns a handle for the queue.
dflet 0:50cedd586816 128 *
dflet 0:50cedd586816 129 * @param uxQueueLength The maximum number of items that the queue can contain.
dflet 0:50cedd586816 130 *
dflet 0:50cedd586816 131 * @param uxItemSize The number of bytes each item in the queue will require.
dflet 0:50cedd586816 132 * Items are queued by copy, not by reference, so this is the number of bytes
dflet 0:50cedd586816 133 * that will be copied for each posted item. Each item on the queue must be
dflet 0:50cedd586816 134 * the same size.
dflet 0:50cedd586816 135 *
dflet 0:50cedd586816 136 * @return If the queue is successfully create then a handle to the newly
dflet 0:50cedd586816 137 * created queue is returned. If the queue cannot be created then 0 is
dflet 0:50cedd586816 138 * returned.
dflet 0:50cedd586816 139 *
dflet 0:50cedd586816 140 * Example usage:
dflet 0:50cedd586816 141 <pre>
dflet 0:50cedd586816 142 struct AMessage
dflet 0:50cedd586816 143 {
dflet 0:50cedd586816 144 char ucMessageID;
dflet 0:50cedd586816 145 char ucData[ 20 ];
dflet 0:50cedd586816 146 };
dflet 0:50cedd586816 147
dflet 0:50cedd586816 148 void vATask( void *pvParameters )
dflet 0:50cedd586816 149 {
dflet 0:50cedd586816 150 QueueHandle_t xQueue1, xQueue2;
dflet 0:50cedd586816 151
dflet 0:50cedd586816 152 // Create a queue capable of containing 10 uint32_t values.
dflet 0:50cedd586816 153 xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
dflet 0:50cedd586816 154 if( xQueue1 == 0 )
dflet 0:50cedd586816 155 {
dflet 0:50cedd586816 156 // Queue was not created and must not be used.
dflet 0:50cedd586816 157 }
dflet 0:50cedd586816 158
dflet 0:50cedd586816 159 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 160 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 161 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 162 if( xQueue2 == 0 )
dflet 0:50cedd586816 163 {
dflet 0:50cedd586816 164 // Queue was not created and must not be used.
dflet 0:50cedd586816 165 }
dflet 0:50cedd586816 166
dflet 0:50cedd586816 167 // ... Rest of task code.
dflet 0:50cedd586816 168 }
dflet 0:50cedd586816 169 </pre>
dflet 0:50cedd586816 170 * \defgroup xQueueCreate xQueueCreate
dflet 0:50cedd586816 171 * \ingroup QueueManagement
dflet 0:50cedd586816 172 */
dflet 0:50cedd586816 173 #define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( uxQueueLength, uxItemSize, queueQUEUE_TYPE_BASE )
dflet 0:50cedd586816 174
dflet 0:50cedd586816 175 /**
dflet 0:50cedd586816 176 * queue. h
dflet 0:50cedd586816 177 * <pre>
dflet 0:50cedd586816 178 BaseType_t xQueueSendToToFront(
dflet 0:50cedd586816 179 QueueHandle_t xQueue,
dflet 0:50cedd586816 180 const void *pvItemToQueue,
dflet 0:50cedd586816 181 TickType_t xTicksToWait
dflet 0:50cedd586816 182 );
dflet 0:50cedd586816 183 * </pre>
dflet 0:50cedd586816 184 *
dflet 0:50cedd586816 185 * This is a macro that calls xQueueGenericSend().
dflet 0:50cedd586816 186 *
dflet 0:50cedd586816 187 * Post an item to the front of a queue. The item is queued by copy, not by
dflet 0:50cedd586816 188 * reference. This function must not be called from an interrupt service
dflet 0:50cedd586816 189 * routine. See xQueueSendFromISR () for an alternative which may be used
dflet 0:50cedd586816 190 * in an ISR.
dflet 0:50cedd586816 191 *
dflet 0:50cedd586816 192 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 193 *
dflet 0:50cedd586816 194 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 195 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 196 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 197 * into the queue storage area.
dflet 0:50cedd586816 198 *
dflet 0:50cedd586816 199 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 200 * waiting for space to become available on the queue, should it already
dflet 0:50cedd586816 201 * be full. The call will return immediately if this is set to 0 and the
dflet 0:50cedd586816 202 * queue is full. The time is defined in tick periods so the constant
dflet 0:50cedd586816 203 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 204 *
dflet 0:50cedd586816 205 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
dflet 0:50cedd586816 206 *
dflet 0:50cedd586816 207 * Example usage:
dflet 0:50cedd586816 208 <pre>
dflet 0:50cedd586816 209 struct AMessage
dflet 0:50cedd586816 210 {
dflet 0:50cedd586816 211 char ucMessageID;
dflet 0:50cedd586816 212 char ucData[ 20 ];
dflet 0:50cedd586816 213 } xMessage;
dflet 0:50cedd586816 214
dflet 0:50cedd586816 215 uint32_t ulVar = 10UL;
dflet 0:50cedd586816 216
dflet 0:50cedd586816 217 void vATask( void *pvParameters )
dflet 0:50cedd586816 218 {
dflet 0:50cedd586816 219 QueueHandle_t xQueue1, xQueue2;
dflet 0:50cedd586816 220 struct AMessage *pxMessage;
dflet 0:50cedd586816 221
dflet 0:50cedd586816 222 // Create a queue capable of containing 10 uint32_t values.
dflet 0:50cedd586816 223 xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
dflet 0:50cedd586816 224
dflet 0:50cedd586816 225 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 226 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 227 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 228
dflet 0:50cedd586816 229 // ...
dflet 0:50cedd586816 230
dflet 0:50cedd586816 231 if( xQueue1 != 0 )
dflet 0:50cedd586816 232 {
dflet 0:50cedd586816 233 // Send an uint32_t. Wait for 10 ticks for space to become
dflet 0:50cedd586816 234 // available if necessary.
dflet 0:50cedd586816 235 if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
dflet 0:50cedd586816 236 {
dflet 0:50cedd586816 237 // Failed to post the message, even after 10 ticks.
dflet 0:50cedd586816 238 }
dflet 0:50cedd586816 239 }
dflet 0:50cedd586816 240
dflet 0:50cedd586816 241 if( xQueue2 != 0 )
dflet 0:50cedd586816 242 {
dflet 0:50cedd586816 243 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 244 // queue is already full.
dflet 0:50cedd586816 245 pxMessage = & xMessage;
dflet 0:50cedd586816 246 xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 247 }
dflet 0:50cedd586816 248
dflet 0:50cedd586816 249 // ... Rest of task code.
dflet 0:50cedd586816 250 }
dflet 0:50cedd586816 251 </pre>
dflet 0:50cedd586816 252 * \defgroup xQueueSend xQueueSend
dflet 0:50cedd586816 253 * \ingroup QueueManagement
dflet 0:50cedd586816 254 */
dflet 0:50cedd586816 255 #define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
dflet 0:50cedd586816 256
dflet 0:50cedd586816 257 /**
dflet 0:50cedd586816 258 * queue. h
dflet 0:50cedd586816 259 * <pre>
dflet 0:50cedd586816 260 BaseType_t xQueueSendToBack(
dflet 0:50cedd586816 261 QueueHandle_t xQueue,
dflet 0:50cedd586816 262 const void *pvItemToQueue,
dflet 0:50cedd586816 263 TickType_t xTicksToWait
dflet 0:50cedd586816 264 );
dflet 0:50cedd586816 265 * </pre>
dflet 0:50cedd586816 266 *
dflet 0:50cedd586816 267 * This is a macro that calls xQueueGenericSend().
dflet 0:50cedd586816 268 *
dflet 0:50cedd586816 269 * Post an item to the back of a queue. The item is queued by copy, not by
dflet 0:50cedd586816 270 * reference. This function must not be called from an interrupt service
dflet 0:50cedd586816 271 * routine. See xQueueSendFromISR () for an alternative which may be used
dflet 0:50cedd586816 272 * in an ISR.
dflet 0:50cedd586816 273 *
dflet 0:50cedd586816 274 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 275 *
dflet 0:50cedd586816 276 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 277 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 278 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 279 * into the queue storage area.
dflet 0:50cedd586816 280 *
dflet 0:50cedd586816 281 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 282 * waiting for space to become available on the queue, should it already
dflet 0:50cedd586816 283 * be full. The call will return immediately if this is set to 0 and the queue
dflet 0:50cedd586816 284 * is full. The time is defined in tick periods so the constant
dflet 0:50cedd586816 285 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 286 *
dflet 0:50cedd586816 287 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
dflet 0:50cedd586816 288 *
dflet 0:50cedd586816 289 * Example usage:
dflet 0:50cedd586816 290 <pre>
dflet 0:50cedd586816 291 struct AMessage
dflet 0:50cedd586816 292 {
dflet 0:50cedd586816 293 char ucMessageID;
dflet 0:50cedd586816 294 char ucData[ 20 ];
dflet 0:50cedd586816 295 } xMessage;
dflet 0:50cedd586816 296
dflet 0:50cedd586816 297 uint32_t ulVar = 10UL;
dflet 0:50cedd586816 298
dflet 0:50cedd586816 299 void vATask( void *pvParameters )
dflet 0:50cedd586816 300 {
dflet 0:50cedd586816 301 QueueHandle_t xQueue1, xQueue2;
dflet 0:50cedd586816 302 struct AMessage *pxMessage;
dflet 0:50cedd586816 303
dflet 0:50cedd586816 304 // Create a queue capable of containing 10 uint32_t values.
dflet 0:50cedd586816 305 xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
dflet 0:50cedd586816 306
dflet 0:50cedd586816 307 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 308 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 309 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 310
dflet 0:50cedd586816 311 // ...
dflet 0:50cedd586816 312
dflet 0:50cedd586816 313 if( xQueue1 != 0 )
dflet 0:50cedd586816 314 {
dflet 0:50cedd586816 315 // Send an uint32_t. Wait for 10 ticks for space to become
dflet 0:50cedd586816 316 // available if necessary.
dflet 0:50cedd586816 317 if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
dflet 0:50cedd586816 318 {
dflet 0:50cedd586816 319 // Failed to post the message, even after 10 ticks.
dflet 0:50cedd586816 320 }
dflet 0:50cedd586816 321 }
dflet 0:50cedd586816 322
dflet 0:50cedd586816 323 if( xQueue2 != 0 )
dflet 0:50cedd586816 324 {
dflet 0:50cedd586816 325 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 326 // queue is already full.
dflet 0:50cedd586816 327 pxMessage = & xMessage;
dflet 0:50cedd586816 328 xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 329 }
dflet 0:50cedd586816 330
dflet 0:50cedd586816 331 // ... Rest of task code.
dflet 0:50cedd586816 332 }
dflet 0:50cedd586816 333 </pre>
dflet 0:50cedd586816 334 * \defgroup xQueueSend xQueueSend
dflet 0:50cedd586816 335 * \ingroup QueueManagement
dflet 0:50cedd586816 336 */
dflet 0:50cedd586816 337 #define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
dflet 0:50cedd586816 338
dflet 0:50cedd586816 339 /**
dflet 0:50cedd586816 340 * queue. h
dflet 0:50cedd586816 341 * <pre>
dflet 0:50cedd586816 342 BaseType_t xQueueSend(
dflet 0:50cedd586816 343 QueueHandle_t xQueue,
dflet 0:50cedd586816 344 const void * pvItemToQueue,
dflet 0:50cedd586816 345 TickType_t xTicksToWait
dflet 0:50cedd586816 346 );
dflet 0:50cedd586816 347 * </pre>
dflet 0:50cedd586816 348 *
dflet 0:50cedd586816 349 * This is a macro that calls xQueueGenericSend(). It is included for
dflet 0:50cedd586816 350 * backward compatibility with versions of FreeRTOS.org that did not
dflet 0:50cedd586816 351 * include the xQueueSendToFront() and xQueueSendToBack() macros. It is
dflet 0:50cedd586816 352 * equivalent to xQueueSendToBack().
dflet 0:50cedd586816 353 *
dflet 0:50cedd586816 354 * Post an item on a queue. The item is queued by copy, not by reference.
dflet 0:50cedd586816 355 * This function must not be called from an interrupt service routine.
dflet 0:50cedd586816 356 * See xQueueSendFromISR () for an alternative which may be used in an ISR.
dflet 0:50cedd586816 357 *
dflet 0:50cedd586816 358 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 359 *
dflet 0:50cedd586816 360 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 361 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 362 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 363 * into the queue storage area.
dflet 0:50cedd586816 364 *
dflet 0:50cedd586816 365 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 366 * waiting for space to become available on the queue, should it already
dflet 0:50cedd586816 367 * be full. The call will return immediately if this is set to 0 and the
dflet 0:50cedd586816 368 * queue is full. The time is defined in tick periods so the constant
dflet 0:50cedd586816 369 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 370 *
dflet 0:50cedd586816 371 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
dflet 0:50cedd586816 372 *
dflet 0:50cedd586816 373 * Example usage:
dflet 0:50cedd586816 374 <pre>
dflet 0:50cedd586816 375 struct AMessage
dflet 0:50cedd586816 376 {
dflet 0:50cedd586816 377 char ucMessageID;
dflet 0:50cedd586816 378 char ucData[ 20 ];
dflet 0:50cedd586816 379 } xMessage;
dflet 0:50cedd586816 380
dflet 0:50cedd586816 381 uint32_t ulVar = 10UL;
dflet 0:50cedd586816 382
dflet 0:50cedd586816 383 void vATask( void *pvParameters )
dflet 0:50cedd586816 384 {
dflet 0:50cedd586816 385 QueueHandle_t xQueue1, xQueue2;
dflet 0:50cedd586816 386 struct AMessage *pxMessage;
dflet 0:50cedd586816 387
dflet 0:50cedd586816 388 // Create a queue capable of containing 10 uint32_t values.
dflet 0:50cedd586816 389 xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
dflet 0:50cedd586816 390
dflet 0:50cedd586816 391 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 392 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 393 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 394
dflet 0:50cedd586816 395 // ...
dflet 0:50cedd586816 396
dflet 0:50cedd586816 397 if( xQueue1 != 0 )
dflet 0:50cedd586816 398 {
dflet 0:50cedd586816 399 // Send an uint32_t. Wait for 10 ticks for space to become
dflet 0:50cedd586816 400 // available if necessary.
dflet 0:50cedd586816 401 if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
dflet 0:50cedd586816 402 {
dflet 0:50cedd586816 403 // Failed to post the message, even after 10 ticks.
dflet 0:50cedd586816 404 }
dflet 0:50cedd586816 405 }
dflet 0:50cedd586816 406
dflet 0:50cedd586816 407 if( xQueue2 != 0 )
dflet 0:50cedd586816 408 {
dflet 0:50cedd586816 409 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 410 // queue is already full.
dflet 0:50cedd586816 411 pxMessage = & xMessage;
dflet 0:50cedd586816 412 xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 413 }
dflet 0:50cedd586816 414
dflet 0:50cedd586816 415 // ... Rest of task code.
dflet 0:50cedd586816 416 }
dflet 0:50cedd586816 417 </pre>
dflet 0:50cedd586816 418 * \defgroup xQueueSend xQueueSend
dflet 0:50cedd586816 419 * \ingroup QueueManagement
dflet 0:50cedd586816 420 */
dflet 0:50cedd586816 421 #define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
dflet 0:50cedd586816 422
dflet 0:50cedd586816 423 /**
dflet 0:50cedd586816 424 * queue. h
dflet 0:50cedd586816 425 * <pre>
dflet 0:50cedd586816 426 BaseType_t xQueueOverwrite(
dflet 0:50cedd586816 427 QueueHandle_t xQueue,
dflet 0:50cedd586816 428 const void * pvItemToQueue
dflet 0:50cedd586816 429 );
dflet 0:50cedd586816 430 * </pre>
dflet 0:50cedd586816 431 *
dflet 0:50cedd586816 432 * Only for use with queues that have a length of one - so the queue is either
dflet 0:50cedd586816 433 * empty or full.
dflet 0:50cedd586816 434 *
dflet 0:50cedd586816 435 * Post an item on a queue. If the queue is already full then overwrite the
dflet 0:50cedd586816 436 * value held in the queue. The item is queued by copy, not by reference.
dflet 0:50cedd586816 437 *
dflet 0:50cedd586816 438 * This function must not be called from an interrupt service routine.
dflet 0:50cedd586816 439 * See xQueueOverwriteFromISR () for an alternative which may be used in an ISR.
dflet 0:50cedd586816 440 *
dflet 0:50cedd586816 441 * @param xQueue The handle of the queue to which the data is being sent.
dflet 0:50cedd586816 442 *
dflet 0:50cedd586816 443 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 444 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 445 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 446 * into the queue storage area.
dflet 0:50cedd586816 447 *
dflet 0:50cedd586816 448 * @return xQueueOverwrite() is a macro that calls xQueueGenericSend(), and
dflet 0:50cedd586816 449 * therefore has the same return values as xQueueSendToFront(). However, pdPASS
dflet 0:50cedd586816 450 * is the only value that can be returned because xQueueOverwrite() will write
dflet 0:50cedd586816 451 * to the queue even when the queue is already full.
dflet 0:50cedd586816 452 *
dflet 0:50cedd586816 453 * Example usage:
dflet 0:50cedd586816 454 <pre>
dflet 0:50cedd586816 455
dflet 0:50cedd586816 456 void vFunction( void *pvParameters )
dflet 0:50cedd586816 457 {
dflet 0:50cedd586816 458 QueueHandle_t xQueue;
dflet 0:50cedd586816 459 uint32_t ulVarToSend, ulValReceived;
dflet 0:50cedd586816 460
dflet 0:50cedd586816 461 // Create a queue to hold one uint32_t value. It is strongly
dflet 0:50cedd586816 462 // recommended *not* to use xQueueOverwrite() on queues that can
dflet 0:50cedd586816 463 // contain more than one value, and doing so will trigger an assertion
dflet 0:50cedd586816 464 // if configASSERT() is defined.
dflet 0:50cedd586816 465 xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
dflet 0:50cedd586816 466
dflet 0:50cedd586816 467 // Write the value 10 to the queue using xQueueOverwrite().
dflet 0:50cedd586816 468 ulVarToSend = 10;
dflet 0:50cedd586816 469 xQueueOverwrite( xQueue, &ulVarToSend );
dflet 0:50cedd586816 470
dflet 0:50cedd586816 471 // Peeking the queue should now return 10, but leave the value 10 in
dflet 0:50cedd586816 472 // the queue. A block time of zero is used as it is known that the
dflet 0:50cedd586816 473 // queue holds a value.
dflet 0:50cedd586816 474 ulValReceived = 0;
dflet 0:50cedd586816 475 xQueuePeek( xQueue, &ulValReceived, 0 );
dflet 0:50cedd586816 476
dflet 0:50cedd586816 477 if( ulValReceived != 10 )
dflet 0:50cedd586816 478 {
dflet 0:50cedd586816 479 // Error unless the item was removed by a different task.
dflet 0:50cedd586816 480 }
dflet 0:50cedd586816 481
dflet 0:50cedd586816 482 // The queue is still full. Use xQueueOverwrite() to overwrite the
dflet 0:50cedd586816 483 // value held in the queue with 100.
dflet 0:50cedd586816 484 ulVarToSend = 100;
dflet 0:50cedd586816 485 xQueueOverwrite( xQueue, &ulVarToSend );
dflet 0:50cedd586816 486
dflet 0:50cedd586816 487 // This time read from the queue, leaving the queue empty once more.
dflet 0:50cedd586816 488 // A block time of 0 is used again.
dflet 0:50cedd586816 489 xQueueReceive( xQueue, &ulValReceived, 0 );
dflet 0:50cedd586816 490
dflet 0:50cedd586816 491 // The value read should be the last value written, even though the
dflet 0:50cedd586816 492 // queue was already full when the value was written.
dflet 0:50cedd586816 493 if( ulValReceived != 100 )
dflet 0:50cedd586816 494 {
dflet 0:50cedd586816 495 // Error!
dflet 0:50cedd586816 496 }
dflet 0:50cedd586816 497
dflet 0:50cedd586816 498 // ...
dflet 0:50cedd586816 499 }
dflet 0:50cedd586816 500 </pre>
dflet 0:50cedd586816 501 * \defgroup xQueueOverwrite xQueueOverwrite
dflet 0:50cedd586816 502 * \ingroup QueueManagement
dflet 0:50cedd586816 503 */
dflet 0:50cedd586816 504 #define xQueueOverwrite( xQueue, pvItemToQueue ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE )
dflet 0:50cedd586816 505
dflet 0:50cedd586816 506
dflet 0:50cedd586816 507 /**
dflet 0:50cedd586816 508 * queue. h
dflet 0:50cedd586816 509 * <pre>
dflet 0:50cedd586816 510 BaseType_t xQueueGenericSend(
dflet 0:50cedd586816 511 QueueHandle_t xQueue,
dflet 0:50cedd586816 512 const void * pvItemToQueue,
dflet 0:50cedd586816 513 TickType_t xTicksToWait
dflet 0:50cedd586816 514 BaseType_t xCopyPosition
dflet 0:50cedd586816 515 );
dflet 0:50cedd586816 516 * </pre>
dflet 0:50cedd586816 517 *
dflet 0:50cedd586816 518 * It is preferred that the macros xQueueSend(), xQueueSendToFront() and
dflet 0:50cedd586816 519 * xQueueSendToBack() are used in place of calling this function directly.
dflet 0:50cedd586816 520 *
dflet 0:50cedd586816 521 * Post an item on a queue. The item is queued by copy, not by reference.
dflet 0:50cedd586816 522 * This function must not be called from an interrupt service routine.
dflet 0:50cedd586816 523 * See xQueueSendFromISR () for an alternative which may be used in an ISR.
dflet 0:50cedd586816 524 *
dflet 0:50cedd586816 525 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 526 *
dflet 0:50cedd586816 527 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 528 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 529 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 530 * into the queue storage area.
dflet 0:50cedd586816 531 *
dflet 0:50cedd586816 532 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 533 * waiting for space to become available on the queue, should it already
dflet 0:50cedd586816 534 * be full. The call will return immediately if this is set to 0 and the
dflet 0:50cedd586816 535 * queue is full. The time is defined in tick periods so the constant
dflet 0:50cedd586816 536 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 537 *
dflet 0:50cedd586816 538 * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
dflet 0:50cedd586816 539 * item at the back of the queue, or queueSEND_TO_FRONT to place the item
dflet 0:50cedd586816 540 * at the front of the queue (for high priority messages).
dflet 0:50cedd586816 541 *
dflet 0:50cedd586816 542 * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
dflet 0:50cedd586816 543 *
dflet 0:50cedd586816 544 * Example usage:
dflet 0:50cedd586816 545 <pre>
dflet 0:50cedd586816 546 struct AMessage
dflet 0:50cedd586816 547 {
dflet 0:50cedd586816 548 char ucMessageID;
dflet 0:50cedd586816 549 char ucData[ 20 ];
dflet 0:50cedd586816 550 } xMessage;
dflet 0:50cedd586816 551
dflet 0:50cedd586816 552 uint32_t ulVar = 10UL;
dflet 0:50cedd586816 553
dflet 0:50cedd586816 554 void vATask( void *pvParameters )
dflet 0:50cedd586816 555 {
dflet 0:50cedd586816 556 QueueHandle_t xQueue1, xQueue2;
dflet 0:50cedd586816 557 struct AMessage *pxMessage;
dflet 0:50cedd586816 558
dflet 0:50cedd586816 559 // Create a queue capable of containing 10 uint32_t values.
dflet 0:50cedd586816 560 xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
dflet 0:50cedd586816 561
dflet 0:50cedd586816 562 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 563 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 564 xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 565
dflet 0:50cedd586816 566 // ...
dflet 0:50cedd586816 567
dflet 0:50cedd586816 568 if( xQueue1 != 0 )
dflet 0:50cedd586816 569 {
dflet 0:50cedd586816 570 // Send an uint32_t. Wait for 10 ticks for space to become
dflet 0:50cedd586816 571 // available if necessary.
dflet 0:50cedd586816 572 if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10, queueSEND_TO_BACK ) != pdPASS )
dflet 0:50cedd586816 573 {
dflet 0:50cedd586816 574 // Failed to post the message, even after 10 ticks.
dflet 0:50cedd586816 575 }
dflet 0:50cedd586816 576 }
dflet 0:50cedd586816 577
dflet 0:50cedd586816 578 if( xQueue2 != 0 )
dflet 0:50cedd586816 579 {
dflet 0:50cedd586816 580 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 581 // queue is already full.
dflet 0:50cedd586816 582 pxMessage = & xMessage;
dflet 0:50cedd586816 583 xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0, queueSEND_TO_BACK );
dflet 0:50cedd586816 584 }
dflet 0:50cedd586816 585
dflet 0:50cedd586816 586 // ... Rest of task code.
dflet 0:50cedd586816 587 }
dflet 0:50cedd586816 588 </pre>
dflet 0:50cedd586816 589 * \defgroup xQueueSend xQueueSend
dflet 0:50cedd586816 590 * \ingroup QueueManagement
dflet 0:50cedd586816 591 */
dflet 0:50cedd586816 592 BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 593
dflet 0:50cedd586816 594 /**
dflet 0:50cedd586816 595 * queue. h
dflet 0:50cedd586816 596 * <pre>
dflet 0:50cedd586816 597 BaseType_t xQueuePeek(
dflet 0:50cedd586816 598 QueueHandle_t xQueue,
dflet 0:50cedd586816 599 void *pvBuffer,
dflet 0:50cedd586816 600 TickType_t xTicksToWait
dflet 0:50cedd586816 601 );</pre>
dflet 0:50cedd586816 602 *
dflet 0:50cedd586816 603 * This is a macro that calls the xQueueGenericReceive() function.
dflet 0:50cedd586816 604 *
dflet 0:50cedd586816 605 * Receive an item from a queue without removing the item from the queue.
dflet 0:50cedd586816 606 * The item is received by copy so a buffer of adequate size must be
dflet 0:50cedd586816 607 * provided. The number of bytes copied into the buffer was defined when
dflet 0:50cedd586816 608 * the queue was created.
dflet 0:50cedd586816 609 *
dflet 0:50cedd586816 610 * Successfully received items remain on the queue so will be returned again
dflet 0:50cedd586816 611 * by the next call, or a call to xQueueReceive().
dflet 0:50cedd586816 612 *
dflet 0:50cedd586816 613 * This macro must not be used in an interrupt service routine. See
dflet 0:50cedd586816 614 * xQueuePeekFromISR() for an alternative that can be called from an interrupt
dflet 0:50cedd586816 615 * service routine.
dflet 0:50cedd586816 616 *
dflet 0:50cedd586816 617 * @param xQueue The handle to the queue from which the item is to be
dflet 0:50cedd586816 618 * received.
dflet 0:50cedd586816 619 *
dflet 0:50cedd586816 620 * @param pvBuffer Pointer to the buffer into which the received item will
dflet 0:50cedd586816 621 * be copied.
dflet 0:50cedd586816 622 *
dflet 0:50cedd586816 623 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 624 * waiting for an item to receive should the queue be empty at the time
dflet 0:50cedd586816 625 * of the call. The time is defined in tick periods so the constant
dflet 0:50cedd586816 626 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 627 * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
dflet 0:50cedd586816 628 * is empty.
dflet 0:50cedd586816 629 *
dflet 0:50cedd586816 630 * @return pdTRUE if an item was successfully received from the queue,
dflet 0:50cedd586816 631 * otherwise pdFALSE.
dflet 0:50cedd586816 632 *
dflet 0:50cedd586816 633 * Example usage:
dflet 0:50cedd586816 634 <pre>
dflet 0:50cedd586816 635 struct AMessage
dflet 0:50cedd586816 636 {
dflet 0:50cedd586816 637 char ucMessageID;
dflet 0:50cedd586816 638 char ucData[ 20 ];
dflet 0:50cedd586816 639 } xMessage;
dflet 0:50cedd586816 640
dflet 0:50cedd586816 641 QueueHandle_t xQueue;
dflet 0:50cedd586816 642
dflet 0:50cedd586816 643 // Task to create a queue and post a value.
dflet 0:50cedd586816 644 void vATask( void *pvParameters )
dflet 0:50cedd586816 645 {
dflet 0:50cedd586816 646 struct AMessage *pxMessage;
dflet 0:50cedd586816 647
dflet 0:50cedd586816 648 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 649 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 650 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 651 if( xQueue == 0 )
dflet 0:50cedd586816 652 {
dflet 0:50cedd586816 653 // Failed to create the queue.
dflet 0:50cedd586816 654 }
dflet 0:50cedd586816 655
dflet 0:50cedd586816 656 // ...
dflet 0:50cedd586816 657
dflet 0:50cedd586816 658 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 659 // queue is already full.
dflet 0:50cedd586816 660 pxMessage = & xMessage;
dflet 0:50cedd586816 661 xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 662
dflet 0:50cedd586816 663 // ... Rest of task code.
dflet 0:50cedd586816 664 }
dflet 0:50cedd586816 665
dflet 0:50cedd586816 666 // Task to peek the data from the queue.
dflet 0:50cedd586816 667 void vADifferentTask( void *pvParameters )
dflet 0:50cedd586816 668 {
dflet 0:50cedd586816 669 struct AMessage *pxRxedMessage;
dflet 0:50cedd586816 670
dflet 0:50cedd586816 671 if( xQueue != 0 )
dflet 0:50cedd586816 672 {
dflet 0:50cedd586816 673 // Peek a message on the created queue. Block for 10 ticks if a
dflet 0:50cedd586816 674 // message is not immediately available.
dflet 0:50cedd586816 675 if( xQueuePeek( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
dflet 0:50cedd586816 676 {
dflet 0:50cedd586816 677 // pcRxedMessage now points to the struct AMessage variable posted
dflet 0:50cedd586816 678 // by vATask, but the item still remains on the queue.
dflet 0:50cedd586816 679 }
dflet 0:50cedd586816 680 }
dflet 0:50cedd586816 681
dflet 0:50cedd586816 682 // ... Rest of task code.
dflet 0:50cedd586816 683 }
dflet 0:50cedd586816 684 </pre>
dflet 0:50cedd586816 685 * \defgroup xQueueReceive xQueueReceive
dflet 0:50cedd586816 686 * \ingroup QueueManagement
dflet 0:50cedd586816 687 */
dflet 0:50cedd586816 688 #define xQueuePeek( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )
dflet 0:50cedd586816 689
dflet 0:50cedd586816 690 /**
dflet 0:50cedd586816 691 * queue. h
dflet 0:50cedd586816 692 * <pre>
dflet 0:50cedd586816 693 BaseType_t xQueuePeekFromISR(
dflet 0:50cedd586816 694 QueueHandle_t xQueue,
dflet 0:50cedd586816 695 void *pvBuffer,
dflet 0:50cedd586816 696 );</pre>
dflet 0:50cedd586816 697 *
dflet 0:50cedd586816 698 * A version of xQueuePeek() that can be called from an interrupt service
dflet 0:50cedd586816 699 * routine (ISR).
dflet 0:50cedd586816 700 *
dflet 0:50cedd586816 701 * Receive an item from a queue without removing the item from the queue.
dflet 0:50cedd586816 702 * The item is received by copy so a buffer of adequate size must be
dflet 0:50cedd586816 703 * provided. The number of bytes copied into the buffer was defined when
dflet 0:50cedd586816 704 * the queue was created.
dflet 0:50cedd586816 705 *
dflet 0:50cedd586816 706 * Successfully received items remain on the queue so will be returned again
dflet 0:50cedd586816 707 * by the next call, or a call to xQueueReceive().
dflet 0:50cedd586816 708 *
dflet 0:50cedd586816 709 * @param xQueue The handle to the queue from which the item is to be
dflet 0:50cedd586816 710 * received.
dflet 0:50cedd586816 711 *
dflet 0:50cedd586816 712 * @param pvBuffer Pointer to the buffer into which the received item will
dflet 0:50cedd586816 713 * be copied.
dflet 0:50cedd586816 714 *
dflet 0:50cedd586816 715 * @return pdTRUE if an item was successfully received from the queue,
dflet 0:50cedd586816 716 * otherwise pdFALSE.
dflet 0:50cedd586816 717 *
dflet 0:50cedd586816 718 * \defgroup xQueuePeekFromISR xQueuePeekFromISR
dflet 0:50cedd586816 719 * \ingroup QueueManagement
dflet 0:50cedd586816 720 */
dflet 0:50cedd586816 721 BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 722
dflet 0:50cedd586816 723 /**
dflet 0:50cedd586816 724 * queue. h
dflet 0:50cedd586816 725 * <pre>
dflet 0:50cedd586816 726 BaseType_t xQueueReceive(
dflet 0:50cedd586816 727 QueueHandle_t xQueue,
dflet 0:50cedd586816 728 void *pvBuffer,
dflet 0:50cedd586816 729 TickType_t xTicksToWait
dflet 0:50cedd586816 730 );</pre>
dflet 0:50cedd586816 731 *
dflet 0:50cedd586816 732 * This is a macro that calls the xQueueGenericReceive() function.
dflet 0:50cedd586816 733 *
dflet 0:50cedd586816 734 * Receive an item from a queue. The item is received by copy so a buffer of
dflet 0:50cedd586816 735 * adequate size must be provided. The number of bytes copied into the buffer
dflet 0:50cedd586816 736 * was defined when the queue was created.
dflet 0:50cedd586816 737 *
dflet 0:50cedd586816 738 * Successfully received items are removed from the queue.
dflet 0:50cedd586816 739 *
dflet 0:50cedd586816 740 * This function must not be used in an interrupt service routine. See
dflet 0:50cedd586816 741 * xQueueReceiveFromISR for an alternative that can.
dflet 0:50cedd586816 742 *
dflet 0:50cedd586816 743 * @param xQueue The handle to the queue from which the item is to be
dflet 0:50cedd586816 744 * received.
dflet 0:50cedd586816 745 *
dflet 0:50cedd586816 746 * @param pvBuffer Pointer to the buffer into which the received item will
dflet 0:50cedd586816 747 * be copied.
dflet 0:50cedd586816 748 *
dflet 0:50cedd586816 749 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 750 * waiting for an item to receive should the queue be empty at the time
dflet 0:50cedd586816 751 * of the call. xQueueReceive() will return immediately if xTicksToWait
dflet 0:50cedd586816 752 * is zero and the queue is empty. The time is defined in tick periods so the
dflet 0:50cedd586816 753 * constant portTICK_PERIOD_MS should be used to convert to real time if this is
dflet 0:50cedd586816 754 * required.
dflet 0:50cedd586816 755 *
dflet 0:50cedd586816 756 * @return pdTRUE if an item was successfully received from the queue,
dflet 0:50cedd586816 757 * otherwise pdFALSE.
dflet 0:50cedd586816 758 *
dflet 0:50cedd586816 759 * Example usage:
dflet 0:50cedd586816 760 <pre>
dflet 0:50cedd586816 761 struct AMessage
dflet 0:50cedd586816 762 {
dflet 0:50cedd586816 763 char ucMessageID;
dflet 0:50cedd586816 764 char ucData[ 20 ];
dflet 0:50cedd586816 765 } xMessage;
dflet 0:50cedd586816 766
dflet 0:50cedd586816 767 QueueHandle_t xQueue;
dflet 0:50cedd586816 768
dflet 0:50cedd586816 769 // Task to create a queue and post a value.
dflet 0:50cedd586816 770 void vATask( void *pvParameters )
dflet 0:50cedd586816 771 {
dflet 0:50cedd586816 772 struct AMessage *pxMessage;
dflet 0:50cedd586816 773
dflet 0:50cedd586816 774 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 775 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 776 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 777 if( xQueue == 0 )
dflet 0:50cedd586816 778 {
dflet 0:50cedd586816 779 // Failed to create the queue.
dflet 0:50cedd586816 780 }
dflet 0:50cedd586816 781
dflet 0:50cedd586816 782 // ...
dflet 0:50cedd586816 783
dflet 0:50cedd586816 784 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 785 // queue is already full.
dflet 0:50cedd586816 786 pxMessage = & xMessage;
dflet 0:50cedd586816 787 xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 788
dflet 0:50cedd586816 789 // ... Rest of task code.
dflet 0:50cedd586816 790 }
dflet 0:50cedd586816 791
dflet 0:50cedd586816 792 // Task to receive from the queue.
dflet 0:50cedd586816 793 void vADifferentTask( void *pvParameters )
dflet 0:50cedd586816 794 {
dflet 0:50cedd586816 795 struct AMessage *pxRxedMessage;
dflet 0:50cedd586816 796
dflet 0:50cedd586816 797 if( xQueue != 0 )
dflet 0:50cedd586816 798 {
dflet 0:50cedd586816 799 // Receive a message on the created queue. Block for 10 ticks if a
dflet 0:50cedd586816 800 // message is not immediately available.
dflet 0:50cedd586816 801 if( xQueueReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
dflet 0:50cedd586816 802 {
dflet 0:50cedd586816 803 // pcRxedMessage now points to the struct AMessage variable posted
dflet 0:50cedd586816 804 // by vATask.
dflet 0:50cedd586816 805 }
dflet 0:50cedd586816 806 }
dflet 0:50cedd586816 807
dflet 0:50cedd586816 808 // ... Rest of task code.
dflet 0:50cedd586816 809 }
dflet 0:50cedd586816 810 </pre>
dflet 0:50cedd586816 811 * \defgroup xQueueReceive xQueueReceive
dflet 0:50cedd586816 812 * \ingroup QueueManagement
dflet 0:50cedd586816 813 */
dflet 0:50cedd586816 814 #define xQueueReceive( xQueue, pvBuffer, xTicksToWait ) xQueueGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )
dflet 0:50cedd586816 815
dflet 0:50cedd586816 816
dflet 0:50cedd586816 817 /**
dflet 0:50cedd586816 818 * queue. h
dflet 0:50cedd586816 819 * <pre>
dflet 0:50cedd586816 820 BaseType_t xQueueGenericReceive(
dflet 0:50cedd586816 821 QueueHandle_t xQueue,
dflet 0:50cedd586816 822 void *pvBuffer,
dflet 0:50cedd586816 823 TickType_t xTicksToWait
dflet 0:50cedd586816 824 BaseType_t xJustPeek
dflet 0:50cedd586816 825 );</pre>
dflet 0:50cedd586816 826 *
dflet 0:50cedd586816 827 * It is preferred that the macro xQueueReceive() be used rather than calling
dflet 0:50cedd586816 828 * this function directly.
dflet 0:50cedd586816 829 *
dflet 0:50cedd586816 830 * Receive an item from a queue. The item is received by copy so a buffer of
dflet 0:50cedd586816 831 * adequate size must be provided. The number of bytes copied into the buffer
dflet 0:50cedd586816 832 * was defined when the queue was created.
dflet 0:50cedd586816 833 *
dflet 0:50cedd586816 834 * This function must not be used in an interrupt service routine. See
dflet 0:50cedd586816 835 * xQueueReceiveFromISR for an alternative that can.
dflet 0:50cedd586816 836 *
dflet 0:50cedd586816 837 * @param xQueue The handle to the queue from which the item is to be
dflet 0:50cedd586816 838 * received.
dflet 0:50cedd586816 839 *
dflet 0:50cedd586816 840 * @param pvBuffer Pointer to the buffer into which the received item will
dflet 0:50cedd586816 841 * be copied.
dflet 0:50cedd586816 842 *
dflet 0:50cedd586816 843 * @param xTicksToWait The maximum amount of time the task should block
dflet 0:50cedd586816 844 * waiting for an item to receive should the queue be empty at the time
dflet 0:50cedd586816 845 * of the call. The time is defined in tick periods so the constant
dflet 0:50cedd586816 846 * portTICK_PERIOD_MS should be used to convert to real time if this is required.
dflet 0:50cedd586816 847 * xQueueGenericReceive() will return immediately if the queue is empty and
dflet 0:50cedd586816 848 * xTicksToWait is 0.
dflet 0:50cedd586816 849 *
dflet 0:50cedd586816 850 * @param xJustPeek When set to true, the item received from the queue is not
dflet 0:50cedd586816 851 * actually removed from the queue - meaning a subsequent call to
dflet 0:50cedd586816 852 * xQueueReceive() will return the same item. When set to false, the item
dflet 0:50cedd586816 853 * being received from the queue is also removed from the queue.
dflet 0:50cedd586816 854 *
dflet 0:50cedd586816 855 * @return pdTRUE if an item was successfully received from the queue,
dflet 0:50cedd586816 856 * otherwise pdFALSE.
dflet 0:50cedd586816 857 *
dflet 0:50cedd586816 858 * Example usage:
dflet 0:50cedd586816 859 <pre>
dflet 0:50cedd586816 860 struct AMessage
dflet 0:50cedd586816 861 {
dflet 0:50cedd586816 862 char ucMessageID;
dflet 0:50cedd586816 863 char ucData[ 20 ];
dflet 0:50cedd586816 864 } xMessage;
dflet 0:50cedd586816 865
dflet 0:50cedd586816 866 QueueHandle_t xQueue;
dflet 0:50cedd586816 867
dflet 0:50cedd586816 868 // Task to create a queue and post a value.
dflet 0:50cedd586816 869 void vATask( void *pvParameters )
dflet 0:50cedd586816 870 {
dflet 0:50cedd586816 871 struct AMessage *pxMessage;
dflet 0:50cedd586816 872
dflet 0:50cedd586816 873 // Create a queue capable of containing 10 pointers to AMessage structures.
dflet 0:50cedd586816 874 // These should be passed by pointer as they contain a lot of data.
dflet 0:50cedd586816 875 xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
dflet 0:50cedd586816 876 if( xQueue == 0 )
dflet 0:50cedd586816 877 {
dflet 0:50cedd586816 878 // Failed to create the queue.
dflet 0:50cedd586816 879 }
dflet 0:50cedd586816 880
dflet 0:50cedd586816 881 // ...
dflet 0:50cedd586816 882
dflet 0:50cedd586816 883 // Send a pointer to a struct AMessage object. Don't block if the
dflet 0:50cedd586816 884 // queue is already full.
dflet 0:50cedd586816 885 pxMessage = & xMessage;
dflet 0:50cedd586816 886 xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
dflet 0:50cedd586816 887
dflet 0:50cedd586816 888 // ... Rest of task code.
dflet 0:50cedd586816 889 }
dflet 0:50cedd586816 890
dflet 0:50cedd586816 891 // Task to receive from the queue.
dflet 0:50cedd586816 892 void vADifferentTask( void *pvParameters )
dflet 0:50cedd586816 893 {
dflet 0:50cedd586816 894 struct AMessage *pxRxedMessage;
dflet 0:50cedd586816 895
dflet 0:50cedd586816 896 if( xQueue != 0 )
dflet 0:50cedd586816 897 {
dflet 0:50cedd586816 898 // Receive a message on the created queue. Block for 10 ticks if a
dflet 0:50cedd586816 899 // message is not immediately available.
dflet 0:50cedd586816 900 if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
dflet 0:50cedd586816 901 {
dflet 0:50cedd586816 902 // pcRxedMessage now points to the struct AMessage variable posted
dflet 0:50cedd586816 903 // by vATask.
dflet 0:50cedd586816 904 }
dflet 0:50cedd586816 905 }
dflet 0:50cedd586816 906
dflet 0:50cedd586816 907 // ... Rest of task code.
dflet 0:50cedd586816 908 }
dflet 0:50cedd586816 909 </pre>
dflet 0:50cedd586816 910 * \defgroup xQueueReceive xQueueReceive
dflet 0:50cedd586816 911 * \ingroup QueueManagement
dflet 0:50cedd586816 912 */
dflet 0:50cedd586816 913 BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 914
dflet 0:50cedd586816 915 /**
dflet 0:50cedd586816 916 * queue. h
dflet 0:50cedd586816 917 * <pre>UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );</pre>
dflet 0:50cedd586816 918 *
dflet 0:50cedd586816 919 * Return the number of messages stored in a queue.
dflet 0:50cedd586816 920 *
dflet 0:50cedd586816 921 * @param xQueue A handle to the queue being queried.
dflet 0:50cedd586816 922 *
dflet 0:50cedd586816 923 * @return The number of messages available in the queue.
dflet 0:50cedd586816 924 *
dflet 0:50cedd586816 925 * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
dflet 0:50cedd586816 926 * \ingroup QueueManagement
dflet 0:50cedd586816 927 */
dflet 0:50cedd586816 928 UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 929
dflet 0:50cedd586816 930 /**
dflet 0:50cedd586816 931 * queue. h
dflet 0:50cedd586816 932 * <pre>UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );</pre>
dflet 0:50cedd586816 933 *
dflet 0:50cedd586816 934 * Return the number of free spaces available in a queue. This is equal to the
dflet 0:50cedd586816 935 * number of items that can be sent to the queue before the queue becomes full
dflet 0:50cedd586816 936 * if no items are removed.
dflet 0:50cedd586816 937 *
dflet 0:50cedd586816 938 * @param xQueue A handle to the queue being queried.
dflet 0:50cedd586816 939 *
dflet 0:50cedd586816 940 * @return The number of spaces available in the queue.
dflet 0:50cedd586816 941 *
dflet 0:50cedd586816 942 * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
dflet 0:50cedd586816 943 * \ingroup QueueManagement
dflet 0:50cedd586816 944 */
dflet 0:50cedd586816 945 UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 946
dflet 0:50cedd586816 947 /**
dflet 0:50cedd586816 948 * queue. h
dflet 0:50cedd586816 949 * <pre>void vQueueDelete( QueueHandle_t xQueue );</pre>
dflet 0:50cedd586816 950 *
dflet 0:50cedd586816 951 * Delete a queue - freeing all the memory allocated for storing of items
dflet 0:50cedd586816 952 * placed on the queue.
dflet 0:50cedd586816 953 *
dflet 0:50cedd586816 954 * @param xQueue A handle to the queue to be deleted.
dflet 0:50cedd586816 955 *
dflet 0:50cedd586816 956 * \defgroup vQueueDelete vQueueDelete
dflet 0:50cedd586816 957 * \ingroup QueueManagement
dflet 0:50cedd586816 958 */
dflet 0:50cedd586816 959 void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 960
dflet 0:50cedd586816 961 /**
dflet 0:50cedd586816 962 * queue. h
dflet 0:50cedd586816 963 * <pre>
dflet 0:50cedd586816 964 BaseType_t xQueueSendToFrontFromISR(
dflet 0:50cedd586816 965 QueueHandle_t xQueue,
dflet 0:50cedd586816 966 const void *pvItemToQueue,
dflet 0:50cedd586816 967 BaseType_t *pxHigherPriorityTaskWoken
dflet 0:50cedd586816 968 );
dflet 0:50cedd586816 969 </pre>
dflet 0:50cedd586816 970 *
dflet 0:50cedd586816 971 * This is a macro that calls xQueueGenericSendFromISR().
dflet 0:50cedd586816 972 *
dflet 0:50cedd586816 973 * Post an item to the front of a queue. It is safe to use this macro from
dflet 0:50cedd586816 974 * within an interrupt service routine.
dflet 0:50cedd586816 975 *
dflet 0:50cedd586816 976 * Items are queued by copy not reference so it is preferable to only
dflet 0:50cedd586816 977 * queue small items, especially when called from an ISR. In most cases
dflet 0:50cedd586816 978 * it would be preferable to store a pointer to the item being queued.
dflet 0:50cedd586816 979 *
dflet 0:50cedd586816 980 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 981 *
dflet 0:50cedd586816 982 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 983 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 984 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 985 * into the queue storage area.
dflet 0:50cedd586816 986 *
dflet 0:50cedd586816 987 * @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
dflet 0:50cedd586816 988 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
dflet 0:50cedd586816 989 * to unblock, and the unblocked task has a priority higher than the currently
dflet 0:50cedd586816 990 * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
dflet 0:50cedd586816 991 * a context switch should be requested before the interrupt is exited.
dflet 0:50cedd586816 992 *
dflet 0:50cedd586816 993 * @return pdTRUE if the data was successfully sent to the queue, otherwise
dflet 0:50cedd586816 994 * errQUEUE_FULL.
dflet 0:50cedd586816 995 *
dflet 0:50cedd586816 996 * Example usage for buffered IO (where the ISR can obtain more than one value
dflet 0:50cedd586816 997 * per call):
dflet 0:50cedd586816 998 <pre>
dflet 0:50cedd586816 999 void vBufferISR( void )
dflet 0:50cedd586816 1000 {
dflet 0:50cedd586816 1001 char cIn;
dflet 0:50cedd586816 1002 BaseType_t xHigherPrioritTaskWoken;
dflet 0:50cedd586816 1003
dflet 0:50cedd586816 1004 // We have not woken a task at the start of the ISR.
dflet 0:50cedd586816 1005 xHigherPriorityTaskWoken = pdFALSE;
dflet 0:50cedd586816 1006
dflet 0:50cedd586816 1007 // Loop until the buffer is empty.
dflet 0:50cedd586816 1008 do
dflet 0:50cedd586816 1009 {
dflet 0:50cedd586816 1010 // Obtain a byte from the buffer.
dflet 0:50cedd586816 1011 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
dflet 0:50cedd586816 1012
dflet 0:50cedd586816 1013 // Post the byte.
dflet 0:50cedd586816 1014 xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
dflet 0:50cedd586816 1015
dflet 0:50cedd586816 1016 } while( portINPUT_BYTE( BUFFER_COUNT ) );
dflet 0:50cedd586816 1017
dflet 0:50cedd586816 1018 // Now the buffer is empty we can switch context if necessary.
dflet 0:50cedd586816 1019 if( xHigherPriorityTaskWoken )
dflet 0:50cedd586816 1020 {
dflet 0:50cedd586816 1021 taskYIELD ();
dflet 0:50cedd586816 1022 }
dflet 0:50cedd586816 1023 }
dflet 0:50cedd586816 1024 </pre>
dflet 0:50cedd586816 1025 *
dflet 0:50cedd586816 1026 * \defgroup xQueueSendFromISR xQueueSendFromISR
dflet 0:50cedd586816 1027 * \ingroup QueueManagement
dflet 0:50cedd586816 1028 */
dflet 0:50cedd586816 1029 #define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
dflet 0:50cedd586816 1030
dflet 0:50cedd586816 1031
dflet 0:50cedd586816 1032 /**
dflet 0:50cedd586816 1033 * queue. h
dflet 0:50cedd586816 1034 * <pre>
dflet 0:50cedd586816 1035 BaseType_t xQueueSendToBackFromISR(
dflet 0:50cedd586816 1036 QueueHandle_t xQueue,
dflet 0:50cedd586816 1037 const void *pvItemToQueue,
dflet 0:50cedd586816 1038 BaseType_t *pxHigherPriorityTaskWoken
dflet 0:50cedd586816 1039 );
dflet 0:50cedd586816 1040 </pre>
dflet 0:50cedd586816 1041 *
dflet 0:50cedd586816 1042 * This is a macro that calls xQueueGenericSendFromISR().
dflet 0:50cedd586816 1043 *
dflet 0:50cedd586816 1044 * Post an item to the back of a queue. It is safe to use this macro from
dflet 0:50cedd586816 1045 * within an interrupt service routine.
dflet 0:50cedd586816 1046 *
dflet 0:50cedd586816 1047 * Items are queued by copy not reference so it is preferable to only
dflet 0:50cedd586816 1048 * queue small items, especially when called from an ISR. In most cases
dflet 0:50cedd586816 1049 * it would be preferable to store a pointer to the item being queued.
dflet 0:50cedd586816 1050 *
dflet 0:50cedd586816 1051 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 1052 *
dflet 0:50cedd586816 1053 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 1054 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 1055 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 1056 * into the queue storage area.
dflet 0:50cedd586816 1057 *
dflet 0:50cedd586816 1058 * @param pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set
dflet 0:50cedd586816 1059 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
dflet 0:50cedd586816 1060 * to unblock, and the unblocked task has a priority higher than the currently
dflet 0:50cedd586816 1061 * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then
dflet 0:50cedd586816 1062 * a context switch should be requested before the interrupt is exited.
dflet 0:50cedd586816 1063 *
dflet 0:50cedd586816 1064 * @return pdTRUE if the data was successfully sent to the queue, otherwise
dflet 0:50cedd586816 1065 * errQUEUE_FULL.
dflet 0:50cedd586816 1066 *
dflet 0:50cedd586816 1067 * Example usage for buffered IO (where the ISR can obtain more than one value
dflet 0:50cedd586816 1068 * per call):
dflet 0:50cedd586816 1069 <pre>
dflet 0:50cedd586816 1070 void vBufferISR( void )
dflet 0:50cedd586816 1071 {
dflet 0:50cedd586816 1072 char cIn;
dflet 0:50cedd586816 1073 BaseType_t xHigherPriorityTaskWoken;
dflet 0:50cedd586816 1074
dflet 0:50cedd586816 1075 // We have not woken a task at the start of the ISR.
dflet 0:50cedd586816 1076 xHigherPriorityTaskWoken = pdFALSE;
dflet 0:50cedd586816 1077
dflet 0:50cedd586816 1078 // Loop until the buffer is empty.
dflet 0:50cedd586816 1079 do
dflet 0:50cedd586816 1080 {
dflet 0:50cedd586816 1081 // Obtain a byte from the buffer.
dflet 0:50cedd586816 1082 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
dflet 0:50cedd586816 1083
dflet 0:50cedd586816 1084 // Post the byte.
dflet 0:50cedd586816 1085 xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
dflet 0:50cedd586816 1086
dflet 0:50cedd586816 1087 } while( portINPUT_BYTE( BUFFER_COUNT ) );
dflet 0:50cedd586816 1088
dflet 0:50cedd586816 1089 // Now the buffer is empty we can switch context if necessary.
dflet 0:50cedd586816 1090 if( xHigherPriorityTaskWoken )
dflet 0:50cedd586816 1091 {
dflet 0:50cedd586816 1092 taskYIELD ();
dflet 0:50cedd586816 1093 }
dflet 0:50cedd586816 1094 }
dflet 0:50cedd586816 1095 </pre>
dflet 0:50cedd586816 1096 *
dflet 0:50cedd586816 1097 * \defgroup xQueueSendFromISR xQueueSendFromISR
dflet 0:50cedd586816 1098 * \ingroup QueueManagement
dflet 0:50cedd586816 1099 */
dflet 0:50cedd586816 1100 #define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
dflet 0:50cedd586816 1101
dflet 0:50cedd586816 1102 /**
dflet 0:50cedd586816 1103 * queue. h
dflet 0:50cedd586816 1104 * <pre>
dflet 0:50cedd586816 1105 BaseType_t xQueueOverwriteFromISR(
dflet 0:50cedd586816 1106 QueueHandle_t xQueue,
dflet 0:50cedd586816 1107 const void * pvItemToQueue,
dflet 0:50cedd586816 1108 BaseType_t *pxHigherPriorityTaskWoken
dflet 0:50cedd586816 1109 );
dflet 0:50cedd586816 1110 * </pre>
dflet 0:50cedd586816 1111 *
dflet 0:50cedd586816 1112 * A version of xQueueOverwrite() that can be used in an interrupt service
dflet 0:50cedd586816 1113 * routine (ISR).
dflet 0:50cedd586816 1114 *
dflet 0:50cedd586816 1115 * Only for use with queues that can hold a single item - so the queue is either
dflet 0:50cedd586816 1116 * empty or full.
dflet 0:50cedd586816 1117 *
dflet 0:50cedd586816 1118 * Post an item on a queue. If the queue is already full then overwrite the
dflet 0:50cedd586816 1119 * value held in the queue. The item is queued by copy, not by reference.
dflet 0:50cedd586816 1120 *
dflet 0:50cedd586816 1121 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 1122 *
dflet 0:50cedd586816 1123 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 1124 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 1125 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 1126 * into the queue storage area.
dflet 0:50cedd586816 1127 *
dflet 0:50cedd586816 1128 * @param pxHigherPriorityTaskWoken xQueueOverwriteFromISR() will set
dflet 0:50cedd586816 1129 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
dflet 0:50cedd586816 1130 * to unblock, and the unblocked task has a priority higher than the currently
dflet 0:50cedd586816 1131 * running task. If xQueueOverwriteFromISR() sets this value to pdTRUE then
dflet 0:50cedd586816 1132 * a context switch should be requested before the interrupt is exited.
dflet 0:50cedd586816 1133 *
dflet 0:50cedd586816 1134 * @return xQueueOverwriteFromISR() is a macro that calls
dflet 0:50cedd586816 1135 * xQueueGenericSendFromISR(), and therefore has the same return values as
dflet 0:50cedd586816 1136 * xQueueSendToFrontFromISR(). However, pdPASS is the only value that can be
dflet 0:50cedd586816 1137 * returned because xQueueOverwriteFromISR() will write to the queue even when
dflet 0:50cedd586816 1138 * the queue is already full.
dflet 0:50cedd586816 1139 *
dflet 0:50cedd586816 1140 * Example usage:
dflet 0:50cedd586816 1141 <pre>
dflet 0:50cedd586816 1142
dflet 0:50cedd586816 1143 QueueHandle_t xQueue;
dflet 0:50cedd586816 1144
dflet 0:50cedd586816 1145 void vFunction( void *pvParameters )
dflet 0:50cedd586816 1146 {
dflet 0:50cedd586816 1147 // Create a queue to hold one uint32_t value. It is strongly
dflet 0:50cedd586816 1148 // recommended *not* to use xQueueOverwriteFromISR() on queues that can
dflet 0:50cedd586816 1149 // contain more than one value, and doing so will trigger an assertion
dflet 0:50cedd586816 1150 // if configASSERT() is defined.
dflet 0:50cedd586816 1151 xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
dflet 0:50cedd586816 1152 }
dflet 0:50cedd586816 1153
dflet 0:50cedd586816 1154 void vAnInterruptHandler( void )
dflet 0:50cedd586816 1155 {
dflet 0:50cedd586816 1156 // xHigherPriorityTaskWoken must be set to pdFALSE before it is used.
dflet 0:50cedd586816 1157 BaseType_t xHigherPriorityTaskWoken = pdFALSE;
dflet 0:50cedd586816 1158 uint32_t ulVarToSend, ulValReceived;
dflet 0:50cedd586816 1159
dflet 0:50cedd586816 1160 // Write the value 10 to the queue using xQueueOverwriteFromISR().
dflet 0:50cedd586816 1161 ulVarToSend = 10;
dflet 0:50cedd586816 1162 xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
dflet 0:50cedd586816 1163
dflet 0:50cedd586816 1164 // The queue is full, but calling xQueueOverwriteFromISR() again will still
dflet 0:50cedd586816 1165 // pass because the value held in the queue will be overwritten with the
dflet 0:50cedd586816 1166 // new value.
dflet 0:50cedd586816 1167 ulVarToSend = 100;
dflet 0:50cedd586816 1168 xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
dflet 0:50cedd586816 1169
dflet 0:50cedd586816 1170 // Reading from the queue will now return 100.
dflet 0:50cedd586816 1171
dflet 0:50cedd586816 1172 // ...
dflet 0:50cedd586816 1173
dflet 0:50cedd586816 1174 if( xHigherPrioritytaskWoken == pdTRUE )
dflet 0:50cedd586816 1175 {
dflet 0:50cedd586816 1176 // Writing to the queue caused a task to unblock and the unblocked task
dflet 0:50cedd586816 1177 // has a priority higher than or equal to the priority of the currently
dflet 0:50cedd586816 1178 // executing task (the task this interrupt interrupted). Perform a context
dflet 0:50cedd586816 1179 // switch so this interrupt returns directly to the unblocked task.
dflet 0:50cedd586816 1180 portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
dflet 0:50cedd586816 1181 }
dflet 0:50cedd586816 1182 }
dflet 0:50cedd586816 1183 </pre>
dflet 0:50cedd586816 1184 * \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
dflet 0:50cedd586816 1185 * \ingroup QueueManagement
dflet 0:50cedd586816 1186 */
dflet 0:50cedd586816 1187 #define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE )
dflet 0:50cedd586816 1188
dflet 0:50cedd586816 1189 /**
dflet 0:50cedd586816 1190 * queue. h
dflet 0:50cedd586816 1191 * <pre>
dflet 0:50cedd586816 1192 BaseType_t xQueueSendFromISR(
dflet 0:50cedd586816 1193 QueueHandle_t xQueue,
dflet 0:50cedd586816 1194 const void *pvItemToQueue,
dflet 0:50cedd586816 1195 BaseType_t *pxHigherPriorityTaskWoken
dflet 0:50cedd586816 1196 );
dflet 0:50cedd586816 1197 </pre>
dflet 0:50cedd586816 1198 *
dflet 0:50cedd586816 1199 * This is a macro that calls xQueueGenericSendFromISR(). It is included
dflet 0:50cedd586816 1200 * for backward compatibility with versions of FreeRTOS.org that did not
dflet 0:50cedd586816 1201 * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR()
dflet 0:50cedd586816 1202 * macros.
dflet 0:50cedd586816 1203 *
dflet 0:50cedd586816 1204 * Post an item to the back of a queue. It is safe to use this function from
dflet 0:50cedd586816 1205 * within an interrupt service routine.
dflet 0:50cedd586816 1206 *
dflet 0:50cedd586816 1207 * Items are queued by copy not reference so it is preferable to only
dflet 0:50cedd586816 1208 * queue small items, especially when called from an ISR. In most cases
dflet 0:50cedd586816 1209 * it would be preferable to store a pointer to the item being queued.
dflet 0:50cedd586816 1210 *
dflet 0:50cedd586816 1211 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 1212 *
dflet 0:50cedd586816 1213 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 1214 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 1215 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 1216 * into the queue storage area.
dflet 0:50cedd586816 1217 *
dflet 0:50cedd586816 1218 * @param pxHigherPriorityTaskWoken xQueueSendFromISR() will set
dflet 0:50cedd586816 1219 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
dflet 0:50cedd586816 1220 * to unblock, and the unblocked task has a priority higher than the currently
dflet 0:50cedd586816 1221 * running task. If xQueueSendFromISR() sets this value to pdTRUE then
dflet 0:50cedd586816 1222 * a context switch should be requested before the interrupt is exited.
dflet 0:50cedd586816 1223 *
dflet 0:50cedd586816 1224 * @return pdTRUE if the data was successfully sent to the queue, otherwise
dflet 0:50cedd586816 1225 * errQUEUE_FULL.
dflet 0:50cedd586816 1226 *
dflet 0:50cedd586816 1227 * Example usage for buffered IO (where the ISR can obtain more than one value
dflet 0:50cedd586816 1228 * per call):
dflet 0:50cedd586816 1229 <pre>
dflet 0:50cedd586816 1230 void vBufferISR( void )
dflet 0:50cedd586816 1231 {
dflet 0:50cedd586816 1232 char cIn;
dflet 0:50cedd586816 1233 BaseType_t xHigherPriorityTaskWoken;
dflet 0:50cedd586816 1234
dflet 0:50cedd586816 1235 // We have not woken a task at the start of the ISR.
dflet 0:50cedd586816 1236 xHigherPriorityTaskWoken = pdFALSE;
dflet 0:50cedd586816 1237
dflet 0:50cedd586816 1238 // Loop until the buffer is empty.
dflet 0:50cedd586816 1239 do
dflet 0:50cedd586816 1240 {
dflet 0:50cedd586816 1241 // Obtain a byte from the buffer.
dflet 0:50cedd586816 1242 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
dflet 0:50cedd586816 1243
dflet 0:50cedd586816 1244 // Post the byte.
dflet 0:50cedd586816 1245 xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
dflet 0:50cedd586816 1246
dflet 0:50cedd586816 1247 } while( portINPUT_BYTE( BUFFER_COUNT ) );
dflet 0:50cedd586816 1248
dflet 0:50cedd586816 1249 // Now the buffer is empty we can switch context if necessary.
dflet 0:50cedd586816 1250 if( xHigherPriorityTaskWoken )
dflet 0:50cedd586816 1251 {
dflet 0:50cedd586816 1252 // Actual macro used here is port specific.
dflet 0:50cedd586816 1253 portYIELD_FROM_ISR ();
dflet 0:50cedd586816 1254 }
dflet 0:50cedd586816 1255 }
dflet 0:50cedd586816 1256 </pre>
dflet 0:50cedd586816 1257 *
dflet 0:50cedd586816 1258 * \defgroup xQueueSendFromISR xQueueSendFromISR
dflet 0:50cedd586816 1259 * \ingroup QueueManagement
dflet 0:50cedd586816 1260 */
dflet 0:50cedd586816 1261 #define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
dflet 0:50cedd586816 1262
dflet 0:50cedd586816 1263 /**
dflet 0:50cedd586816 1264 * queue. h
dflet 0:50cedd586816 1265 * <pre>
dflet 0:50cedd586816 1266 BaseType_t xQueueGenericSendFromISR(
dflet 0:50cedd586816 1267 QueueHandle_t xQueue,
dflet 0:50cedd586816 1268 const void *pvItemToQueue,
dflet 0:50cedd586816 1269 BaseType_t *pxHigherPriorityTaskWoken,
dflet 0:50cedd586816 1270 BaseType_t xCopyPosition
dflet 0:50cedd586816 1271 );
dflet 0:50cedd586816 1272 </pre>
dflet 0:50cedd586816 1273 *
dflet 0:50cedd586816 1274 * It is preferred that the macros xQueueSendFromISR(),
dflet 0:50cedd586816 1275 * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
dflet 0:50cedd586816 1276 * of calling this function directly. xQueueGiveFromISR() is an
dflet 0:50cedd586816 1277 * equivalent for use by semaphores that don't actually copy any data.
dflet 0:50cedd586816 1278 *
dflet 0:50cedd586816 1279 * Post an item on a queue. It is safe to use this function from within an
dflet 0:50cedd586816 1280 * interrupt service routine.
dflet 0:50cedd586816 1281 *
dflet 0:50cedd586816 1282 * Items are queued by copy not reference so it is preferable to only
dflet 0:50cedd586816 1283 * queue small items, especially when called from an ISR. In most cases
dflet 0:50cedd586816 1284 * it would be preferable to store a pointer to the item being queued.
dflet 0:50cedd586816 1285 *
dflet 0:50cedd586816 1286 * @param xQueue The handle to the queue on which the item is to be posted.
dflet 0:50cedd586816 1287 *
dflet 0:50cedd586816 1288 * @param pvItemToQueue A pointer to the item that is to be placed on the
dflet 0:50cedd586816 1289 * queue. The size of the items the queue will hold was defined when the
dflet 0:50cedd586816 1290 * queue was created, so this many bytes will be copied from pvItemToQueue
dflet 0:50cedd586816 1291 * into the queue storage area.
dflet 0:50cedd586816 1292 *
dflet 0:50cedd586816 1293 * @param pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set
dflet 0:50cedd586816 1294 * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
dflet 0:50cedd586816 1295 * to unblock, and the unblocked task has a priority higher than the currently
dflet 0:50cedd586816 1296 * running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then
dflet 0:50cedd586816 1297 * a context switch should be requested before the interrupt is exited.
dflet 0:50cedd586816 1298 *
dflet 0:50cedd586816 1299 * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
dflet 0:50cedd586816 1300 * item at the back of the queue, or queueSEND_TO_FRONT to place the item
dflet 0:50cedd586816 1301 * at the front of the queue (for high priority messages).
dflet 0:50cedd586816 1302 *
dflet 0:50cedd586816 1303 * @return pdTRUE if the data was successfully sent to the queue, otherwise
dflet 0:50cedd586816 1304 * errQUEUE_FULL.
dflet 0:50cedd586816 1305 *
dflet 0:50cedd586816 1306 * Example usage for buffered IO (where the ISR can obtain more than one value
dflet 0:50cedd586816 1307 * per call):
dflet 0:50cedd586816 1308 <pre>
dflet 0:50cedd586816 1309 void vBufferISR( void )
dflet 0:50cedd586816 1310 {
dflet 0:50cedd586816 1311 char cIn;
dflet 0:50cedd586816 1312 BaseType_t xHigherPriorityTaskWokenByPost;
dflet 0:50cedd586816 1313
dflet 0:50cedd586816 1314 // We have not woken a task at the start of the ISR.
dflet 0:50cedd586816 1315 xHigherPriorityTaskWokenByPost = pdFALSE;
dflet 0:50cedd586816 1316
dflet 0:50cedd586816 1317 // Loop until the buffer is empty.
dflet 0:50cedd586816 1318 do
dflet 0:50cedd586816 1319 {
dflet 0:50cedd586816 1320 // Obtain a byte from the buffer.
dflet 0:50cedd586816 1321 cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
dflet 0:50cedd586816 1322
dflet 0:50cedd586816 1323 // Post each byte.
dflet 0:50cedd586816 1324 xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK );
dflet 0:50cedd586816 1325
dflet 0:50cedd586816 1326 } while( portINPUT_BYTE( BUFFER_COUNT ) );
dflet 0:50cedd586816 1327
dflet 0:50cedd586816 1328 // Now the buffer is empty we can switch context if necessary. Note that the
dflet 0:50cedd586816 1329 // name of the yield function required is port specific.
dflet 0:50cedd586816 1330 if( xHigherPriorityTaskWokenByPost )
dflet 0:50cedd586816 1331 {
dflet 0:50cedd586816 1332 taskYIELD_YIELD_FROM_ISR();
dflet 0:50cedd586816 1333 }
dflet 0:50cedd586816 1334 }
dflet 0:50cedd586816 1335 </pre>
dflet 0:50cedd586816 1336 *
dflet 0:50cedd586816 1337 * \defgroup xQueueSendFromISR xQueueSendFromISR
dflet 0:50cedd586816 1338 * \ingroup QueueManagement
dflet 0:50cedd586816 1339 */
dflet 0:50cedd586816 1340 BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1341 BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1342
dflet 0:50cedd586816 1343 /**
dflet 0:50cedd586816 1344 * queue. h
dflet 0:50cedd586816 1345 * <pre>
dflet 0:50cedd586816 1346 BaseType_t xQueueReceiveFromISR(
dflet 0:50cedd586816 1347 QueueHandle_t xQueue,
dflet 0:50cedd586816 1348 void *pvBuffer,
dflet 0:50cedd586816 1349 BaseType_t *pxTaskWoken
dflet 0:50cedd586816 1350 );
dflet 0:50cedd586816 1351 * </pre>
dflet 0:50cedd586816 1352 *
dflet 0:50cedd586816 1353 * Receive an item from a queue. It is safe to use this function from within an
dflet 0:50cedd586816 1354 * interrupt service routine.
dflet 0:50cedd586816 1355 *
dflet 0:50cedd586816 1356 * @param xQueue The handle to the queue from which the item is to be
dflet 0:50cedd586816 1357 * received.
dflet 0:50cedd586816 1358 *
dflet 0:50cedd586816 1359 * @param pvBuffer Pointer to the buffer into which the received item will
dflet 0:50cedd586816 1360 * be copied.
dflet 0:50cedd586816 1361 *
dflet 0:50cedd586816 1362 * @param pxTaskWoken A task may be blocked waiting for space to become
dflet 0:50cedd586816 1363 * available on the queue. If xQueueReceiveFromISR causes such a task to
dflet 0:50cedd586816 1364 * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
dflet 0:50cedd586816 1365 * remain unchanged.
dflet 0:50cedd586816 1366 *
dflet 0:50cedd586816 1367 * @return pdTRUE if an item was successfully received from the queue,
dflet 0:50cedd586816 1368 * otherwise pdFALSE.
dflet 0:50cedd586816 1369 *
dflet 0:50cedd586816 1370 * Example usage:
dflet 0:50cedd586816 1371 <pre>
dflet 0:50cedd586816 1372
dflet 0:50cedd586816 1373 QueueHandle_t xQueue;
dflet 0:50cedd586816 1374
dflet 0:50cedd586816 1375 // Function to create a queue and post some values.
dflet 0:50cedd586816 1376 void vAFunction( void *pvParameters )
dflet 0:50cedd586816 1377 {
dflet 0:50cedd586816 1378 char cValueToPost;
dflet 0:50cedd586816 1379 const TickType_t xTicksToWait = ( TickType_t )0xff;
dflet 0:50cedd586816 1380
dflet 0:50cedd586816 1381 // Create a queue capable of containing 10 characters.
dflet 0:50cedd586816 1382 xQueue = xQueueCreate( 10, sizeof( char ) );
dflet 0:50cedd586816 1383 if( xQueue == 0 )
dflet 0:50cedd586816 1384 {
dflet 0:50cedd586816 1385 // Failed to create the queue.
dflet 0:50cedd586816 1386 }
dflet 0:50cedd586816 1387
dflet 0:50cedd586816 1388 // ...
dflet 0:50cedd586816 1389
dflet 0:50cedd586816 1390 // Post some characters that will be used within an ISR. If the queue
dflet 0:50cedd586816 1391 // is full then this task will block for xTicksToWait ticks.
dflet 0:50cedd586816 1392 cValueToPost = 'a';
dflet 0:50cedd586816 1393 xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
dflet 0:50cedd586816 1394 cValueToPost = 'b';
dflet 0:50cedd586816 1395 xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
dflet 0:50cedd586816 1396
dflet 0:50cedd586816 1397 // ... keep posting characters ... this task may block when the queue
dflet 0:50cedd586816 1398 // becomes full.
dflet 0:50cedd586816 1399
dflet 0:50cedd586816 1400 cValueToPost = 'c';
dflet 0:50cedd586816 1401 xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
dflet 0:50cedd586816 1402 }
dflet 0:50cedd586816 1403
dflet 0:50cedd586816 1404 // ISR that outputs all the characters received on the queue.
dflet 0:50cedd586816 1405 void vISR_Routine( void )
dflet 0:50cedd586816 1406 {
dflet 0:50cedd586816 1407 BaseType_t xTaskWokenByReceive = pdFALSE;
dflet 0:50cedd586816 1408 char cRxedChar;
dflet 0:50cedd586816 1409
dflet 0:50cedd586816 1410 while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
dflet 0:50cedd586816 1411 {
dflet 0:50cedd586816 1412 // A character was received. Output the character now.
dflet 0:50cedd586816 1413 vOutputCharacter( cRxedChar );
dflet 0:50cedd586816 1414
dflet 0:50cedd586816 1415 // If removing the character from the queue woke the task that was
dflet 0:50cedd586816 1416 // posting onto the queue cTaskWokenByReceive will have been set to
dflet 0:50cedd586816 1417 // pdTRUE. No matter how many times this loop iterates only one
dflet 0:50cedd586816 1418 // task will be woken.
dflet 0:50cedd586816 1419 }
dflet 0:50cedd586816 1420
dflet 0:50cedd586816 1421 if( cTaskWokenByPost != ( char ) pdFALSE;
dflet 0:50cedd586816 1422 {
dflet 0:50cedd586816 1423 taskYIELD ();
dflet 0:50cedd586816 1424 }
dflet 0:50cedd586816 1425 }
dflet 0:50cedd586816 1426 </pre>
dflet 0:50cedd586816 1427 * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
dflet 0:50cedd586816 1428 * \ingroup QueueManagement
dflet 0:50cedd586816 1429 */
dflet 0:50cedd586816 1430 BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void * const pvBuffer, BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1431
dflet 0:50cedd586816 1432 /*
dflet 0:50cedd586816 1433 * Utilities to query queues that are safe to use from an ISR. These utilities
dflet 0:50cedd586816 1434 * should be used only from witin an ISR, or within a critical section.
dflet 0:50cedd586816 1435 */
dflet 0:50cedd586816 1436 BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1437 BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1438 UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1439
dflet 0:50cedd586816 1440
dflet 0:50cedd586816 1441 /*
dflet 0:50cedd586816 1442 * xQueueAltGenericSend() is an alternative version of xQueueGenericSend().
dflet 0:50cedd586816 1443 * Likewise xQueueAltGenericReceive() is an alternative version of
dflet 0:50cedd586816 1444 * xQueueGenericReceive().
dflet 0:50cedd586816 1445 *
dflet 0:50cedd586816 1446 * The source code that implements the alternative (Alt) API is much
dflet 0:50cedd586816 1447 * simpler because it executes everything from within a critical section.
dflet 0:50cedd586816 1448 * This is the approach taken by many other RTOSes, but FreeRTOS.org has the
dflet 0:50cedd586816 1449 * preferred fully featured API too. The fully featured API has more
dflet 0:50cedd586816 1450 * complex code that takes longer to execute, but makes much less use of
dflet 0:50cedd586816 1451 * critical sections. Therefore the alternative API sacrifices interrupt
dflet 0:50cedd586816 1452 * responsiveness to gain execution speed, whereas the fully featured API
dflet 0:50cedd586816 1453 * sacrifices execution speed to ensure better interrupt responsiveness.
dflet 0:50cedd586816 1454 */
dflet 0:50cedd586816 1455 BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition );
dflet 0:50cedd586816 1456 BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking );
dflet 0:50cedd586816 1457 #define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
dflet 0:50cedd586816 1458 #define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
dflet 0:50cedd586816 1459 #define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )
dflet 0:50cedd586816 1460 #define xQueueAltPeek( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )
dflet 0:50cedd586816 1461
dflet 0:50cedd586816 1462 /*
dflet 0:50cedd586816 1463 * The functions defined above are for passing data to and from tasks. The
dflet 0:50cedd586816 1464 * functions below are the equivalents for passing data to and from
dflet 0:50cedd586816 1465 * co-routines.
dflet 0:50cedd586816 1466 *
dflet 0:50cedd586816 1467 * These functions are called from the co-routine macro implementation and
dflet 0:50cedd586816 1468 * should not be called directly from application code. Instead use the macro
dflet 0:50cedd586816 1469 * wrappers defined within croutine.h.
dflet 0:50cedd586816 1470 */
dflet 0:50cedd586816 1471 BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t xCoRoutinePreviouslyWoken );
dflet 0:50cedd586816 1472 BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxTaskWoken );
dflet 0:50cedd586816 1473 BaseType_t xQueueCRSend( QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait );
dflet 0:50cedd586816 1474 BaseType_t xQueueCRReceive( QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait );
dflet 0:50cedd586816 1475
dflet 0:50cedd586816 1476 /*
dflet 0:50cedd586816 1477 * For internal use only. Use xSemaphoreCreateMutex(),
dflet 0:50cedd586816 1478 * xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
dflet 0:50cedd586816 1479 * these functions directly.
dflet 0:50cedd586816 1480 */
dflet 0:50cedd586816 1481 QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1482 QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1483 void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1484
dflet 0:50cedd586816 1485 /*
dflet 0:50cedd586816 1486 * For internal use only. Use xSemaphoreTakeMutexRecursive() or
dflet 0:50cedd586816 1487 * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
dflet 0:50cedd586816 1488 */
dflet 0:50cedd586816 1489 BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1490 BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1491
dflet 0:50cedd586816 1492 /*
dflet 0:50cedd586816 1493 * Reset a queue back to its original empty state. The return value is now
dflet 0:50cedd586816 1494 * obsolete and is always set to pdPASS.
dflet 0:50cedd586816 1495 */
dflet 0:50cedd586816 1496 #define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
dflet 0:50cedd586816 1497
dflet 0:50cedd586816 1498 /*
dflet 0:50cedd586816 1499 * The registry is provided as a means for kernel aware debuggers to
dflet 0:50cedd586816 1500 * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
dflet 0:50cedd586816 1501 * a queue, semaphore or mutex handle to the registry if you want the handle
dflet 0:50cedd586816 1502 * to be available to a kernel aware debugger. If you are not using a kernel
dflet 0:50cedd586816 1503 * aware debugger then this function can be ignored.
dflet 0:50cedd586816 1504 *
dflet 0:50cedd586816 1505 * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
dflet 0:50cedd586816 1506 * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
dflet 0:50cedd586816 1507 * within FreeRTOSConfig.h for the registry to be available. Its value
dflet 0:50cedd586816 1508 * does not effect the number of queues, semaphores and mutexes that can be
dflet 0:50cedd586816 1509 * created - just the number that the registry can hold.
dflet 0:50cedd586816 1510 *
dflet 0:50cedd586816 1511 * @param xQueue The handle of the queue being added to the registry. This
dflet 0:50cedd586816 1512 * is the handle returned by a call to xQueueCreate(). Semaphore and mutex
dflet 0:50cedd586816 1513 * handles can also be passed in here.
dflet 0:50cedd586816 1514 *
dflet 0:50cedd586816 1515 * @param pcName The name to be associated with the handle. This is the
dflet 0:50cedd586816 1516 * name that the kernel aware debugger will display. The queue registry only
dflet 0:50cedd586816 1517 * stores a pointer to the string - so the string must be persistent (global or
dflet 0:50cedd586816 1518 * preferably in ROM/Flash), not on the stack.
dflet 0:50cedd586816 1519 */
dflet 0:50cedd586816 1520 #if configQUEUE_REGISTRY_SIZE > 0
dflet 0:50cedd586816 1521 void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
dflet 0:50cedd586816 1522 #endif
dflet 0:50cedd586816 1523
dflet 0:50cedd586816 1524 /*
dflet 0:50cedd586816 1525 * The registry is provided as a means for kernel aware debuggers to
dflet 0:50cedd586816 1526 * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
dflet 0:50cedd586816 1527 * a queue, semaphore or mutex handle to the registry if you want the handle
dflet 0:50cedd586816 1528 * to be available to a kernel aware debugger, and vQueueUnregisterQueue() to
dflet 0:50cedd586816 1529 * remove the queue, semaphore or mutex from the register. If you are not using
dflet 0:50cedd586816 1530 * a kernel aware debugger then this function can be ignored.
dflet 0:50cedd586816 1531 *
dflet 0:50cedd586816 1532 * @param xQueue The handle of the queue being removed from the registry.
dflet 0:50cedd586816 1533 */
dflet 0:50cedd586816 1534 #if configQUEUE_REGISTRY_SIZE > 0
dflet 0:50cedd586816 1535 void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1536 #endif
dflet 0:50cedd586816 1537
dflet 0:50cedd586816 1538 /*
dflet 0:50cedd586816 1539 * Generic version of the queue creation function, which is in turn called by
dflet 0:50cedd586816 1540 * any queue, semaphore or mutex creation function or macro.
dflet 0:50cedd586816 1541 */
dflet 0:50cedd586816 1542 QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1543
dflet 0:50cedd586816 1544 /*
dflet 0:50cedd586816 1545 * Queue sets provide a mechanism to allow a task to block (pend) on a read
dflet 0:50cedd586816 1546 * operation from multiple queues or semaphores simultaneously.
dflet 0:50cedd586816 1547 *
dflet 0:50cedd586816 1548 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
dflet 0:50cedd586816 1549 * function.
dflet 0:50cedd586816 1550 *
dflet 0:50cedd586816 1551 * A queue set must be explicitly created using a call to xQueueCreateSet()
dflet 0:50cedd586816 1552 * before it can be used. Once created, standard FreeRTOS queues and semaphores
dflet 0:50cedd586816 1553 * can be added to the set using calls to xQueueAddToSet().
dflet 0:50cedd586816 1554 * xQueueSelectFromSet() is then used to determine which, if any, of the queues
dflet 0:50cedd586816 1555 * or semaphores contained in the set is in a state where a queue read or
dflet 0:50cedd586816 1556 * semaphore take operation would be successful.
dflet 0:50cedd586816 1557 *
dflet 0:50cedd586816 1558 * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
dflet 0:50cedd586816 1559 * for reasons why queue sets are very rarely needed in practice as there are
dflet 0:50cedd586816 1560 * simpler methods of blocking on multiple objects.
dflet 0:50cedd586816 1561 *
dflet 0:50cedd586816 1562 * Note 2: Blocking on a queue set that contains a mutex will not cause the
dflet 0:50cedd586816 1563 * mutex holder to inherit the priority of the blocked task.
dflet 0:50cedd586816 1564 *
dflet 0:50cedd586816 1565 * Note 3: An additional 4 bytes of RAM is required for each space in a every
dflet 0:50cedd586816 1566 * queue added to a queue set. Therefore counting semaphores that have a high
dflet 0:50cedd586816 1567 * maximum count value should not be added to a queue set.
dflet 0:50cedd586816 1568 *
dflet 0:50cedd586816 1569 * Note 4: A receive (in the case of a queue) or take (in the case of a
dflet 0:50cedd586816 1570 * semaphore) operation must not be performed on a member of a queue set unless
dflet 0:50cedd586816 1571 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
dflet 0:50cedd586816 1572 *
dflet 0:50cedd586816 1573 * @param uxEventQueueLength Queue sets store events that occur on
dflet 0:50cedd586816 1574 * the queues and semaphores contained in the set. uxEventQueueLength specifies
dflet 0:50cedd586816 1575 * the maximum number of events that can be queued at once. To be absolutely
dflet 0:50cedd586816 1576 * certain that events are not lost uxEventQueueLength should be set to the
dflet 0:50cedd586816 1577 * total sum of the length of the queues added to the set, where binary
dflet 0:50cedd586816 1578 * semaphores and mutexes have a length of 1, and counting semaphores have a
dflet 0:50cedd586816 1579 * length set by their maximum count value. Examples:
dflet 0:50cedd586816 1580 * + If a queue set is to hold a queue of length 5, another queue of length 12,
dflet 0:50cedd586816 1581 * and a binary semaphore, then uxEventQueueLength should be set to
dflet 0:50cedd586816 1582 * (5 + 12 + 1), or 18.
dflet 0:50cedd586816 1583 * + If a queue set is to hold three binary semaphores then uxEventQueueLength
dflet 0:50cedd586816 1584 * should be set to (1 + 1 + 1 ), or 3.
dflet 0:50cedd586816 1585 * + If a queue set is to hold a counting semaphore that has a maximum count of
dflet 0:50cedd586816 1586 * 5, and a counting semaphore that has a maximum count of 3, then
dflet 0:50cedd586816 1587 * uxEventQueueLength should be set to (5 + 3), or 8.
dflet 0:50cedd586816 1588 *
dflet 0:50cedd586816 1589 * @return If the queue set is created successfully then a handle to the created
dflet 0:50cedd586816 1590 * queue set is returned. Otherwise NULL is returned.
dflet 0:50cedd586816 1591 */
dflet 0:50cedd586816 1592 QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1593
dflet 0:50cedd586816 1594 /*
dflet 0:50cedd586816 1595 * Adds a queue or semaphore to a queue set that was previously created by a
dflet 0:50cedd586816 1596 * call to xQueueCreateSet().
dflet 0:50cedd586816 1597 *
dflet 0:50cedd586816 1598 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
dflet 0:50cedd586816 1599 * function.
dflet 0:50cedd586816 1600 *
dflet 0:50cedd586816 1601 * Note 1: A receive (in the case of a queue) or take (in the case of a
dflet 0:50cedd586816 1602 * semaphore) operation must not be performed on a member of a queue set unless
dflet 0:50cedd586816 1603 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
dflet 0:50cedd586816 1604 *
dflet 0:50cedd586816 1605 * @param xQueueOrSemaphore The handle of the queue or semaphore being added to
dflet 0:50cedd586816 1606 * the queue set (cast to an QueueSetMemberHandle_t type).
dflet 0:50cedd586816 1607 *
dflet 0:50cedd586816 1608 * @param xQueueSet The handle of the queue set to which the queue or semaphore
dflet 0:50cedd586816 1609 * is being added.
dflet 0:50cedd586816 1610 *
dflet 0:50cedd586816 1611 * @return If the queue or semaphore was successfully added to the queue set
dflet 0:50cedd586816 1612 * then pdPASS is returned. If the queue could not be successfully added to the
dflet 0:50cedd586816 1613 * queue set because it is already a member of a different queue set then pdFAIL
dflet 0:50cedd586816 1614 * is returned.
dflet 0:50cedd586816 1615 */
dflet 0:50cedd586816 1616 BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1617
dflet 0:50cedd586816 1618 /*
dflet 0:50cedd586816 1619 * Removes a queue or semaphore from a queue set. A queue or semaphore can only
dflet 0:50cedd586816 1620 * be removed from a set if the queue or semaphore is empty.
dflet 0:50cedd586816 1621 *
dflet 0:50cedd586816 1622 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
dflet 0:50cedd586816 1623 * function.
dflet 0:50cedd586816 1624 *
dflet 0:50cedd586816 1625 * @param xQueueOrSemaphore The handle of the queue or semaphore being removed
dflet 0:50cedd586816 1626 * from the queue set (cast to an QueueSetMemberHandle_t type).
dflet 0:50cedd586816 1627 *
dflet 0:50cedd586816 1628 * @param xQueueSet The handle of the queue set in which the queue or semaphore
dflet 0:50cedd586816 1629 * is included.
dflet 0:50cedd586816 1630 *
dflet 0:50cedd586816 1631 * @return If the queue or semaphore was successfully removed from the queue set
dflet 0:50cedd586816 1632 * then pdPASS is returned. If the queue was not in the queue set, or the
dflet 0:50cedd586816 1633 * queue (or semaphore) was not empty, then pdFAIL is returned.
dflet 0:50cedd586816 1634 */
dflet 0:50cedd586816 1635 BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1636
dflet 0:50cedd586816 1637 /*
dflet 0:50cedd586816 1638 * xQueueSelectFromSet() selects from the members of a queue set a queue or
dflet 0:50cedd586816 1639 * semaphore that either contains data (in the case of a queue) or is available
dflet 0:50cedd586816 1640 * to take (in the case of a semaphore). xQueueSelectFromSet() effectively
dflet 0:50cedd586816 1641 * allows a task to block (pend) on a read operation on all the queues and
dflet 0:50cedd586816 1642 * semaphores in a queue set simultaneously.
dflet 0:50cedd586816 1643 *
dflet 0:50cedd586816 1644 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
dflet 0:50cedd586816 1645 * function.
dflet 0:50cedd586816 1646 *
dflet 0:50cedd586816 1647 * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
dflet 0:50cedd586816 1648 * for reasons why queue sets are very rarely needed in practice as there are
dflet 0:50cedd586816 1649 * simpler methods of blocking on multiple objects.
dflet 0:50cedd586816 1650 *
dflet 0:50cedd586816 1651 * Note 2: Blocking on a queue set that contains a mutex will not cause the
dflet 0:50cedd586816 1652 * mutex holder to inherit the priority of the blocked task.
dflet 0:50cedd586816 1653 *
dflet 0:50cedd586816 1654 * Note 3: A receive (in the case of a queue) or take (in the case of a
dflet 0:50cedd586816 1655 * semaphore) operation must not be performed on a member of a queue set unless
dflet 0:50cedd586816 1656 * a call to xQueueSelectFromSet() has first returned a handle to that set member.
dflet 0:50cedd586816 1657 *
dflet 0:50cedd586816 1658 * @param xQueueSet The queue set on which the task will (potentially) block.
dflet 0:50cedd586816 1659 *
dflet 0:50cedd586816 1660 * @param xTicksToWait The maximum time, in ticks, that the calling task will
dflet 0:50cedd586816 1661 * remain in the Blocked state (with other tasks executing) to wait for a member
dflet 0:50cedd586816 1662 * of the queue set to be ready for a successful queue read or semaphore take
dflet 0:50cedd586816 1663 * operation.
dflet 0:50cedd586816 1664 *
dflet 0:50cedd586816 1665 * @return xQueueSelectFromSet() will return the handle of a queue (cast to
dflet 0:50cedd586816 1666 * a QueueSetMemberHandle_t type) contained in the queue set that contains data,
dflet 0:50cedd586816 1667 * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained
dflet 0:50cedd586816 1668 * in the queue set that is available, or NULL if no such queue or semaphore
dflet 0:50cedd586816 1669 * exists before before the specified block time expires.
dflet 0:50cedd586816 1670 */
dflet 0:50cedd586816 1671 QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1672
dflet 0:50cedd586816 1673 /*
dflet 0:50cedd586816 1674 * A version of xQueueSelectFromSet() that can be used from an ISR.
dflet 0:50cedd586816 1675 */
dflet 0:50cedd586816 1676 QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1677
dflet 0:50cedd586816 1678 /* Not public API functions. */
dflet 0:50cedd586816 1679 void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1680 BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1681 void vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1682 UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1683 uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
dflet 0:50cedd586816 1684
dflet 0:50cedd586816 1685
dflet 0:50cedd586816 1686 #ifdef __cplusplus
dflet 0:50cedd586816 1687 }
dflet 0:50cedd586816 1688 #endif
dflet 0:50cedd586816 1689
dflet 0:50cedd586816 1690 #endif /* QUEUE_H */
dflet 0:50cedd586816 1691
dflet 0:50cedd586816 1692