2 FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
\r
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
7 This file is part of the FreeRTOS distribution.
\r
9 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
10 the terms of the GNU General Public License (version 2) as published by the
\r
11 Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
\r
13 ***************************************************************************
\r
14 >>! NOTE: The modification to the GPL is included to allow you to !<<
\r
15 >>! distribute a combined work that includes FreeRTOS without being !<<
\r
16 >>! obliged to provide the source code for proprietary components !<<
\r
17 >>! outside of the FreeRTOS kernel. !<<
\r
18 ***************************************************************************
\r
20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
\r
23 link: http://www.freertos.org/a00114.html
\r
25 ***************************************************************************
\r
27 * FreeRTOS provides completely free yet professionally developed, *
\r
28 * robust, strictly quality controlled, supported, and cross *
\r
29 * platform software that is more than just the market leader, it *
\r
30 * is the industry's de facto standard. *
\r
32 * Help yourself get started quickly while simultaneously helping *
\r
33 * to support the FreeRTOS project by purchasing a FreeRTOS *
\r
34 * tutorial book, reference manual, or both: *
\r
35 * http://www.FreeRTOS.org/Documentation *
\r
37 ***************************************************************************
\r
39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
\r
40 the FAQ page "My application does not run, what could be wrong?". Have you
\r
41 defined configASSERT()?
\r
43 http://www.FreeRTOS.org/support - In return for receiving this top quality
\r
44 embedded software for free we request you assist our global community by
\r
45 participating in the support forum.
\r
47 http://www.FreeRTOS.org/training - Investing in training allows your team to
\r
48 be as productive as possible as early as possible. Now you can receive
\r
49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
\r
50 Ltd, and the world's leading authority on the world's leading RTOS.
\r
52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
\r
57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
\r
59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
\r
60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
61 licenses offer ticketed support, indemnification and commercial middleware.
\r
63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
64 engineered and independently SIL3 certified version for use in safety and
\r
65 mission critical applications that require provable dependability.
\r
71 *******************************************************************************
\r
72 * NOTE 1: Do not expect to get real time behaviour from the Win32 port or this
\r
73 * demo application. It is provided as a convenient development and
\r
74 * demonstration test bed only. Windows will not be running the FreeRTOS
\r
75 * threads continuously, so the timing information in the FreeRTOS+Trace logs
\r
76 * have no meaningful units. See the documentation page for the Windows
\r
77 * simulator for further explanation:
\r
78 * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html
\r
79 * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -
\r
81 * NOTE 2: This project provides two demo applications. A simple blinky style
\r
82 * project, and a more comprehensive test and demo application. The
\r
83 * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select
\r
84 * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY
\r
85 * in main.c. This file implements the comprehensive test and demo version.
\r
87 * NOTE 3: This file only contains the source code that is specific to the
\r
88 * basic demo. Generic functions, such FreeRTOS hook functions, are defined in
\r
90 *******************************************************************************
\r
92 * main() creates all the demo application tasks, then starts the scheduler.
\r
93 * The web documentation provides more details of the standard demo application
\r
94 * tasks, which provide no particular functionality but do provide a good
\r
95 * example of how to use the FreeRTOS API.
\r
97 * In addition to the standard demo tasks, the following tasks and tests are
\r
98 * defined and/or created within this file:
\r
100 * "Check" task - This only executes every five seconds but has a high priority
\r
101 * to ensure it gets processor time. Its main function is to check that all the
\r
102 * standard demo tasks are still operational. While no errors have been
\r
103 * discovered the check task will print out "OK" and the current simulated tick
\r
104 * time. If an error is discovered in the execution of a task then the check
\r
105 * task will print out an appropriate error message.
\r
110 /* Standard includes. */
\r
112 #include <stdlib.h>
\r
114 /* Kernel includes. */
\r
115 #include <FreeRTOS.h>
\r
118 #include <timers.h>
\r
119 #include <semphr.h>
\r
121 /* Standard demo includes. */
\r
122 #include "BlockQ.h"
\r
123 #include "integer.h"
\r
124 #include "semtest.h"
\r
126 #include "GenQTest.h"
\r
128 #include "recmutex.h"
\r
130 #include "TimerDemo.h"
\r
131 #include "countsem.h"
\r
133 #include "dynamic.h"
\r
134 #include "QueueSet.h"
\r
135 #include "QueueOverwrite.h"
\r
136 #include "EventGroupsDemo.h"
\r
137 #include "IntSemTest.h"
\r
138 #include "TaskNotify.h"
\r
139 #include "QueueSetPolling.h"
\r
141 /* Priorities at which the tasks are created. */
\r
142 #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
\r
143 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
144 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
145 #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
146 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
147 #define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
148 #define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
149 #define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
150 #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
151 #define mainQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY )
\r
153 #define mainTIMER_TEST_PERIOD ( 50 )
\r
155 /* Task function prototypes. */
\r
156 static void prvCheckTask( void *pvParameters );
\r
158 /* A task that is created from the idle task to test the functionality of
\r
159 eTaskStateGet(). */
\r
160 static void prvTestTask( void *pvParameters );
\r
163 * Called from the idle task hook function to demonstrate a few utility
\r
164 * functions that are not demonstrated by any of the standard demo tasks.
\r
166 static void prvDemonstrateTaskStateAndHandleGetFunctions( void );
\r
169 * Called from the idle task hook function to demonstrate the use of
\r
170 * xTimerPendFunctionCall() as xTimerPendFunctionCall() is not demonstrated by
\r
171 * any of the standard demo tasks.
\r
173 static void prvDemonstratePendingFunctionCall( void );
\r
176 * The function that is pended by prvDemonstratePendingFunctionCall().
\r
178 static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 );
\r
181 * A task to demonstrate the use of the xQueueSpacesAvailable() function.
\r
183 static void prvDemoQueueSpaceFunctions( void *pvParameters );
\r
185 /*-----------------------------------------------------------*/
\r
187 /* The variable into which error messages are latched. */
\r
188 static char *pcStatusMessage = "OK";
\r
190 /* This semaphore is created purely to test using the vSemaphoreDelete() and
\r
191 semaphore tracing API functions. It has no other purpose. */
\r
192 static SemaphoreHandle_t xMutexToDelete = NULL;
\r
194 /*-----------------------------------------------------------*/
\r
196 int main_full( void )
\r
198 /* Start the check task as described at the top of this file. */
\r
199 xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
\r
201 /* Create the standard demo tasks. */
\r
202 vStartTaskNotifyTask();
\r
203 vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
\r
204 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
205 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
206 vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
\r
207 vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
\r
208 vStartQueuePeekTasks();
\r
209 vStartMathTasks( mainFLOP_TASK_PRIORITY );
\r
210 vStartRecursiveMutexTasks();
\r
211 vStartCountingSemaphoreTasks();
\r
212 vStartDynamicPriorityTasks();
\r
213 vStartQueueSetTasks();
\r
214 vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
\r
215 vStartEventGroupTasks();
\r
216 vStartInterruptSemaphoreTasks();
\r
217 vStartQueueSetPollingTask();
\r
218 xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
\r
220 #if( configUSE_PREEMPTION != 0 )
\r
222 /* Don't expect these tasks to pass when preemption is not used. */
\r
223 vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
\r
227 /* The suicide tasks must be created last as they need to know how many
\r
228 tasks were running prior to their creation. This then allows them to
\r
229 ascertain whether or not the correct/expected number of tasks are running at
\r
231 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
233 /* Create the semaphore that will be deleted in the idle task hook. This
\r
234 is done purely to test the use of vSemaphoreDelete(). */
\r
235 xMutexToDelete = xSemaphoreCreateMutex();
\r
237 /* Start the scheduler itself. */
\r
238 vTaskStartScheduler();
\r
240 /* Should never get here unless there was not enough heap space to create
\r
241 the idle and other system tasks. */
\r
244 /*-----------------------------------------------------------*/
\r
246 static void prvCheckTask( void *pvParameters )
\r
248 TickType_t xNextWakeTime;
\r
249 const TickType_t xCycleFrequency = 2500 / portTICK_PERIOD_MS;
\r
251 /* Just to remove compiler warning. */
\r
252 ( void ) pvParameters;
\r
254 /* Initialise xNextWakeTime - this only needs to be done once. */
\r
255 xNextWakeTime = xTaskGetTickCount();
\r
259 /* Place this task in the blocked state until it is time to run again. */
\r
260 vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );
\r
262 /* Check the standard demo tasks are running without error. */
\r
263 #if( configUSE_PREEMPTION != 0 )
\r
265 /* These tasks are only created when preemption is used. */
\r
266 if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )
\r
268 pcStatusMessage = "Error: TimerDemo";
\r
273 if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
\r
275 pcStatusMessage = "Error: Notification";
\r
278 if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
\r
280 pcStatusMessage = "Error: IntSem";
\r
282 else if( xAreEventGroupTasksStillRunning() != pdTRUE )
\r
284 pcStatusMessage = "Error: EventGroup";
\r
286 else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
288 pcStatusMessage = "Error: IntMath";
\r
290 else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
292 pcStatusMessage = "Error: GenQueue";
\r
294 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
296 pcStatusMessage = "Error: QueuePeek";
\r
298 else if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
300 pcStatusMessage = "Error: BlockQueue";
\r
302 else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
304 pcStatusMessage = "Error: SemTest";
\r
306 else if( xArePollingQueuesStillRunning() != pdTRUE )
\r
308 pcStatusMessage = "Error: PollQueue";
\r
310 else if( xAreMathsTaskStillRunning() != pdPASS )
\r
312 pcStatusMessage = "Error: Flop";
\r
314 else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
316 pcStatusMessage = "Error: RecMutex";
\r
318 else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
\r
320 pcStatusMessage = "Error: CountSem";
\r
322 else if( xIsCreateTaskStillRunning() != pdTRUE )
\r
324 pcStatusMessage = "Error: Death";
\r
326 else if( xAreDynamicPriorityTasksStillRunning() != pdPASS )
\r
328 pcStatusMessage = "Error: Dynamic";
\r
330 else if( xAreQueueSetTasksStillRunning() != pdPASS )
\r
332 pcStatusMessage = "Error: Queue set";
\r
334 else if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
\r
336 pcStatusMessage = "Error: Queue overwrite";
\r
338 else if( xAreQueueSetPollTasksStillRunning() != pdPASS )
\r
340 pcStatusMessage = "Error: Queue set polling";
\r
343 /* This is the only task that uses stdout so its ok to call printf()
\r
345 printf( "%s - %d\r\n", pcStatusMessage, xTaskGetTickCount() );
\r
348 /*-----------------------------------------------------------*/
\r
350 static void prvTestTask( void *pvParameters )
\r
352 const unsigned long ulMSToSleep = 5;
\r
354 /* Just to remove compiler warnings. */
\r
355 ( void ) pvParameters;
\r
357 /* This task is just used to test the eTaskStateGet() function. It
\r
358 does not have anything to do. */
\r
361 /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are
\r
362 tasks waiting to be terminated by the idle task. */
\r
363 Sleep( ulMSToSleep );
\r
366 /*-----------------------------------------------------------*/
\r
368 /* Called from vApplicationIdleHook(), which is defined in main.c. */
\r
369 void vFullDemoIdleFunction( void )
\r
371 const unsigned long ulMSToSleep = 15;
\r
374 /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are
\r
375 tasks waiting to be terminated by the idle task. */
\r
376 Sleep( ulMSToSleep );
\r
378 /* Demonstrate a few utility functions that are not demonstrated by any of
\r
379 the standard demo tasks. */
\r
380 prvDemonstrateTaskStateAndHandleGetFunctions();
\r
382 /* Demonstrate the use of xTimerPendFunctionCall(), which is not
\r
383 demonstrated by any of the standard demo tasks. */
\r
384 prvDemonstratePendingFunctionCall();
\r
386 /* If xMutexToDelete has not already been deleted, then delete it now.
\r
387 This is done purely to demonstrate the use of, and test, the
\r
388 vSemaphoreDelete() macro. Care must be taken not to delete a semaphore
\r
389 that has tasks blocked on it. */
\r
390 if( xMutexToDelete != NULL )
\r
392 vSemaphoreDelete( xMutexToDelete );
\r
393 xMutexToDelete = NULL;
\r
396 /* Exercise heap_5 a bit. The malloc failed hook will trap failed
\r
397 allocations so there is no need to test here. */
\r
398 pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );
\r
399 vPortFree( pvAllocated );
\r
401 /*-----------------------------------------------------------*/
\r
403 /* Called by vApplicationTickHook(), which is defined in main.c. */
\r
404 void vFullDemoTickHookFunction( void )
\r
406 TaskHandle_t xTimerTask;
\r
408 /* Call the periodic timer test, which tests the timer API functions that
\r
409 can be called from an ISR. */
\r
410 #if( configUSE_PREEMPTION != 0 )
\r
412 /* Only created when preemption is used. */
\r
413 vTimerPeriodicISRTests();
\r
417 /* Call the periodic queue overwrite from ISR demo. */
\r
418 vQueueOverwritePeriodicISRDemo();
\r
420 /* Write to a queue that is in use as part of the queue set demo to
\r
421 demonstrate using queue sets from an ISR. */
\r
422 vQueueSetAccessQueueSetFromISR();
\r
423 vQueueSetPollingInterruptAccess();
\r
425 /* Exercise event groups from interrupts. */
\r
426 vPeriodicEventGroupsProcessing();
\r
428 /* Exercise giving mutexes from an interrupt. */
\r
429 vInterruptSemaphorePeriodicTest();
\r
431 /* Exercise using task notifications from an interrupt. */
\r
432 xNotifyTaskFromISR();
\r
434 /* For code coverage purposes. */
\r
435 xTimerTask = xTimerGetTimerDaemonTaskHandle();
\r
436 configASSERT( uxTaskPriorityGetFromISR( xTimerTask ) == configTIMER_TASK_PRIORITY );
\r
438 /*-----------------------------------------------------------*/
\r
440 static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 )
\r
442 static uint32_t ulLastParameter1 = 1000UL, ulLastParameter2 = 0UL;
\r
443 uint32_t ulParameter1;
\r
445 ulParameter1 = ( uint32_t ) pvParameter1;
\r
447 /* Ensure the parameters are as expected. */
\r
448 configASSERT( ulParameter1 == ( ulLastParameter1 + 1 ) );
\r
449 configASSERT( ulParameter2 == ( ulLastParameter2 + 1 ) );
\r
451 /* Remember the parameters for the next time the function is called. */
\r
452 ulLastParameter1 = ulParameter1;
\r
453 ulLastParameter2 = ulParameter2;
\r
455 /*-----------------------------------------------------------*/
\r
457 static void prvDemonstratePendingFunctionCall( void )
\r
459 static uint32_t ulParameter1 = 1000UL, ulParameter2 = 0UL;
\r
460 const TickType_t xDontBlock = 0; /* This is called from the idle task so must *not* attempt to block. */
\r
462 /* prvPendedFunction() just expects the parameters to be incremented by one
\r
463 each time it is called. */
\r
467 /* Pend the function call, sending the parameters. */
\r
468 xTimerPendFunctionCall( prvPendedFunction, ( void * ) ulParameter1, ulParameter2, xDontBlock );
\r
470 /*-----------------------------------------------------------*/
\r
472 static void prvDemonstrateTaskStateAndHandleGetFunctions( void )
\r
474 TaskHandle_t xIdleTaskHandle, xTimerTaskHandle;
\r
476 static portBASE_TYPE xPerformedOneShotTests = pdFALSE;
\r
477 TaskHandle_t xTestTask;
\r
479 /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and
\r
480 xTaskGetIdleTaskHandle() functions. Also try using the function that sets
\r
481 the task number. */
\r
482 xIdleTaskHandle = xTaskGetIdleTaskHandle();
\r
483 xTimerTaskHandle = xTimerGetTimerDaemonTaskHandle();
\r
485 /* This is the idle hook, so the current task handle should equal the
\r
486 returned idle task handle. */
\r
487 if( xTaskGetCurrentTaskHandle() != xIdleTaskHandle )
\r
489 pcStatusMessage = "Error: Returned idle task handle was incorrect";
\r
492 /* Check the timer task handle was returned correctly. */
\r
493 pcTaskName = pcTaskGetTaskName( xTimerTaskHandle );
\r
494 if( strcmp( pcTaskName, "Tmr Svc" ) != 0 )
\r
496 pcStatusMessage = "Error: Returned timer task handle was incorrect";
\r
499 /* This task is running, make sure it's state is returned as running. */
\r
500 if( eTaskStateGet( xIdleTaskHandle ) != eRunning )
\r
502 pcStatusMessage = "Error: Returned idle task state was incorrect";
\r
505 /* If this task is running, then the timer task must be blocked. */
\r
506 if( eTaskStateGet( xTimerTaskHandle ) != eBlocked )
\r
508 pcStatusMessage = "Error: Returned timer task state was incorrect";
\r
511 /* Other tests that should only be performed once follow. The test task
\r
512 is not created on each iteration because to do so would cause the death
\r
513 task to report an error (too many tasks running). */
\r
514 if( xPerformedOneShotTests == pdFALSE )
\r
516 /* Don't run this part of the test again. */
\r
517 xPerformedOneShotTests = pdTRUE;
\r
519 /* Create a test task to use to test other eTaskStateGet() return values. */
\r
520 if( xTaskCreate( prvTestTask, "Test", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTestTask ) == pdPASS )
\r
522 /* If this task is running, the test task must be in the ready state. */
\r
523 if( eTaskStateGet( xTestTask ) != eReady )
\r
525 pcStatusMessage = "Error: Returned test task state was incorrect 1";
\r
528 /* Now suspend the test task and check its state is reported correctly. */
\r
529 vTaskSuspend( xTestTask );
\r
530 if( eTaskStateGet( xTestTask ) != eSuspended )
\r
532 pcStatusMessage = "Error: Returned test task state was incorrect 2";
\r
535 /* Now delete the task and check its state is reported correctly. */
\r
536 vTaskDelete( xTestTask );
\r
537 if( eTaskStateGet( xTestTask ) != eDeleted )
\r
539 pcStatusMessage = "Error: Returned test task state was incorrect 3";
\r
544 /*-----------------------------------------------------------*/
\r
546 static void prvDemoQueueSpaceFunctions( void *pvParameters )
\r
548 QueueHandle_t xQueue = NULL;
\r
549 const unsigned portBASE_TYPE uxQueueLength = 10;
\r
550 unsigned portBASE_TYPE uxReturn, x;
\r
552 /* Remove compiler warnings. */
\r
553 ( void ) pvParameters;
\r
555 /* Create the queue that will be used. Nothing is actually going to be
\r
556 sent or received so the queue item size is set to 0. */
\r
557 xQueue = xQueueCreate( uxQueueLength, 0 );
\r
558 configASSERT( xQueue );
\r
562 for( x = 0; x < uxQueueLength; x++ )
\r
564 /* Ask how many messages are available... */
\r
565 uxReturn = uxQueueMessagesWaiting( xQueue );
\r
567 /* Check the number of messages being reported as being available
\r
568 is as expected, and force an assert if not. */
\r
569 if( uxReturn != x )
\r
571 /* xQueue cannot be NULL so this is deliberately causing an
\r
572 assert to be triggered as there is an error. */
\r
573 configASSERT( xQueue == NULL );
\r
576 /* Ask how many spaces remain in the queue... */
\r
577 uxReturn = uxQueueSpacesAvailable( xQueue );
\r
579 /* Check the number of spaces being reported as being available
\r
580 is as expected, and force an assert if not. */
\r
581 if( uxReturn != ( uxQueueLength - x ) )
\r
583 /* xQueue cannot be NULL so this is deliberately causing an
\r
584 assert to be triggered as there is an error. */
\r
585 configASSERT( xQueue == NULL );
\r
588 /* Fill one more space in the queue. */
\r
589 xQueueSendToBack( xQueue, NULL, 0 );
\r
592 /* Perform the same check while the queue is full. */
\r
593 uxReturn = uxQueueMessagesWaiting( xQueue );
\r
594 if( uxReturn != uxQueueLength )
\r
596 configASSERT( xQueue == NULL );
\r
599 uxReturn = uxQueueSpacesAvailable( xQueue );
\r
601 if( uxReturn != 0 )
\r
603 configASSERT( xQueue == NULL );
\r
606 /* The queue is full, start again. */
\r
607 xQueueReset( xQueue );
\r
609 #if( configUSE_PREEMPTION == 0 )
\r