summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/full_demo/main_full.c
blob: c51934d51856c498058e4663f9c73303512697ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
/*
 * FreeRTOS V202104.00
 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * http://www.FreeRTOS.org
 * http://aws.amazon.com/freertos
 *
 * 1 tab == 4 spaces!
 */

/* Standard includes. */
#include <stdio.h>
#include <stdlib.h>

/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
#include "semphr.h"

/* Various test includes. */
#include "BlockQ.h"
#include "integer.h"
#include "semtest.h"
#include "PollQ.h"
#include "GenQTest.h"
#include "QPeek.h"
#include "recmutex.h"
#include "flop.h"
#include "TimerDemo.h"
#include "countsem.h"
#include "death.h"
#include "QueueSet.h"
#include "QueueOverwrite.h"
#include "EventGroupsDemo.h"
#include "IntSemTest.h"
#include "IntQueue.h"
#include "TaskNotify.h"
#include "TaskNotifyArray.h"
#include "QueueSetPolling.h"
#include "StaticAllocation.h"
#include "blocktim.h"
#include "AbortDelay.h"
#include "MessageBufferDemo.h"
#include "StreamBufferDemo.h"
#include "StreamBufferInterrupt.h"
#include "RegTests.h"

/**
 * Priorities at which the tasks are created.
 */
#define mainCHECK_TASK_PRIORITY             ( configMAX_PRIORITIES - 2 )
#define mainQUEUE_POLL_PRIORITY             ( tskIDLE_PRIORITY + 1 )
#define mainSEM_TEST_PRIORITY               ( tskIDLE_PRIORITY + 1 )
#define mainBLOCK_Q_PRIORITY                ( tskIDLE_PRIORITY + 2 )
#define mainCREATOR_TASK_PRIORITY           ( tskIDLE_PRIORITY + 3 )
#define mainFLASH_TASK_PRIORITY             ( tskIDLE_PRIORITY + 1 )
#define mainINTEGER_TASK_PRIORITY           ( tskIDLE_PRIORITY )
#define mainGEN_QUEUE_TASK_PRIORITY         ( tskIDLE_PRIORITY )
#define mainFLOP_TASK_PRIORITY              ( tskIDLE_PRIORITY )
#define mainQUEUE_OVERWRITE_PRIORITY        ( tskIDLE_PRIORITY )
#define mainREGISTER_TEST_PRIORITY          ( tskIDLE_PRIORITY )

/* The period of the check task, in ms, converted to ticks using the
pdMS_TO_TICKS() macro.  mainNO_ERROR_CHECK_TASK_PERIOD is used if no errors have
been found, mainERROR_CHECK_TASK_PERIOD is used if an error has been found. */
#define mainNO_ERROR_CHECK_TASK_PERIOD      pdMS_TO_TICKS( 3000UL )
#define mainERROR_CHECK_TASK_PERIOD         pdMS_TO_TICKS( 500UL )

/**
 * Period used in timer tests.
 */
#define mainTIMER_TEST_PERIOD               ( 50 )

/**
 * Success output messages. This is used by the CI - do not change.
 */
#define mainDEMO_SUCCESS_MESSAGE            "FreeRTOS Demo SUCCESS\r\n"
/*-----------------------------------------------------------*/

/**
 * The task that periodically checks that all the standard demo tasks are
 * still executing and error free.
 */
static void prvCheckTask( void *pvParameters );

/**
 * Called by main() to run the full demo (as opposed to the blinky demo) when
 * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
 */
void main_full( void );

/**
 * Tick hook used by the full demo, which includes code that interacts with
 * some of the tests.
 */
void vFullDemoTickHook( void );
/*-----------------------------------------------------------*/

void main_full( void )
{
BaseType_t xResult;

    xResult = xTaskCreate( prvCheckTask,
                          "Check",
                          configMINIMAL_STACK_SIZE,
                          NULL,
                          mainCHECK_TASK_PRIORITY,
                          NULL );

    if( xResult == pdPASS )
    {
        #if( configSTART_TASK_NOTIFY_TESTS == 1 )
        {
            vStartTaskNotifyTask();
        }
        #endif /* configSTART_TASK_NOTIFY_TESTS */

        #if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
        {
            vStartTaskNotifyArrayTask();
        }
        #endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */

        #if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
        {
            vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
        }
        #endif /* configSTART_BLOCKING_QUEUE_TESTS */

        #if( configSTART_SEMAPHORE_TESTS == 1 )
        {
            vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
        }
        #endif /* configSTART_SEMAPHORE_TESTS */

        #if( configSTART_POLLED_QUEUE_TESTS == 1 )
        {
            vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
        }
        #endif /* configSTART_POLLED_QUEUE_TESTS */

        #if( configSTART_INTEGER_MATH_TESTS == 1 )
        {
            vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
        }
        #endif /* configSTART_INTEGER_MATH_TESTS */

        #if( configSTART_GENERIC_QUEUE_TESTS == 1 )
        {
            vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
        }
        #endif /* configSTART_GENERIC_QUEUE_TESTS */

        #if( configSTART_PEEK_QUEUE_TESTS == 1 )
        {
            vStartQueuePeekTasks();
        }
        #endif /* configSTART_PEEK_QUEUE_TESTS */

        #if( configSTART_MATH_TESTS == 1 )
        {
            vStartMathTasks( mainFLOP_TASK_PRIORITY );
        }
        #endif /* configSTART_MATH_TESTS */

        #if( configSTART_RECURSIVE_MUTEX_TESTS == 1 )
        {
            vStartRecursiveMutexTasks();
        }
        #endif /* configSTART_RECURSIVE_MUTEX_TESTS */

        #if( configSTART_COUNTING_SEMAPHORE_TESTS == 1 )
        {
            vStartCountingSemaphoreTasks();
        }
        #endif /* configSTART_COUNTING_SEMAPHORE_TESTS */

        #if( configSTART_QUEUE_SET_TESTS == 1 )
        {
            vStartQueueSetTasks();
        }
        #endif /* configSTART_QUEUE_SET_TESTS */

        #if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
        {
            vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
        }
        #endif /* configSTART_QUEUE_OVERWRITE_TESTS */

        #if( configSTART_EVENT_GROUP_TESTS == 1 )
        {
            vStartEventGroupTasks();
        }
        #endif /* configSTART_EVENT_GROUP_TESTS */

        #if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
        {
            vStartInterruptSemaphoreTasks();
        }
        #endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */

        #if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
        {
            vStartQueueSetPollingTask();
        }
        #endif /* configSTART_QUEUE_SET_POLLING_TESTS */

        #if( configSTART_BLOCK_TIME_TESTS == 1 )
        {
            vCreateBlockTimeTasks();
        }
        #endif /* configSTART_BLOCK_TIME_TESTS */

        #if( configSTART_ABORT_DELAY_TESTS == 1 )
        {
            vCreateAbortDelayTasks();
        }
        #endif /* configSTART_ABORT_DELAY_TESTS */

        #if( configSTART_MESSAGE_BUFFER_TESTS == 1 )
        {
            vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );
        }
        #endif /* configSTART_MESSAGE_BUFFER_TESTS */

        #if(configSTART_STREAM_BUFFER_TESTS  == 1 )
        {
            vStartStreamBufferTasks();
        }
        #endif /* configSTART_STREAM_BUFFER_TESTS */

        #if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
        {
            vStartStreamBufferInterruptDemo();
        }
        #endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */

        #if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
        {
            /* Don't expect these tasks to pass when preemption is not used. */
            vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
        }
        #endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */

        #if( configSTART_INTERRUPT_QUEUE_TESTS == 1 )
        {
            vStartInterruptQueueTasks();
        }
        #endif /* configSTART_INTERRUPT_QUEUE_TESTS */

        #if( configSTART_REGISTER_TESTS == 1 )
        {
            vStartRegisterTasks( mainREGISTER_TEST_PRIORITY );
        }
        #endif /* configSTART_REGISTER_TESTS */

        #if( configSTART_DELETE_SELF_TESTS == 1 )
        {
            /* The suicide tasks must be created last as they need to know how many
            * tasks were running prior to their creation.  This then allows them to
            * ascertain whether or not the correct/expected number of tasks are
            * running at any given time. */
            vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
        }
        #endif /* configSTART_DELETE_SELF_TESTS */
    }

    vTaskStartScheduler();
}
/*-----------------------------------------------------------*/

void vFullDemoTickHook( void )
{
    /* Called from vApplicationTickHook() when the project is configured to
    build the full test/demo applications. */

    #if( configSTART_TASK_NOTIFY_TESTS == 1 )
    {
        xNotifyTaskFromISR();
    }
    #endif /* configSTART_TASK_NOTIFY_TESTS */

    #if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
    {
        xNotifyArrayTaskFromISR();
    }
    #endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */

    #if( configSTART_QUEUE_SET_TESTS == 1 )
    {
        vQueueSetAccessQueueSetFromISR();
    }
    #endif /* configSTART_QUEUE_SET_TESTS */

    #if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
    {
        vQueueOverwritePeriodicISRDemo();
    }
    #endif /* configSTART_QUEUE_OVERWRITE_TESTS */

    #if( configSTART_EVENT_GROUP_TESTS == 1 )
    {
        vPeriodicEventGroupsProcessing();
    }
    #endif /* configSTART_EVENT_GROUP_TESTS */

    #if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
    {
        vInterruptSemaphorePeriodicTest();
    }
    #endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */

    #if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
    {
        vQueueSetPollingInterruptAccess();
    }
    #endif /* configSTART_QUEUE_SET_POLLING_TESTS */

    #if( configSTART_STREAM_BUFFER_TESTS == 1 )
    {
        vPeriodicStreamBufferProcessing();
    }
    #endif /* configSTART_STREAM_BUFFER_TESTS */

    #if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
    {
        vBasicStreamBufferSendFromISR();
    }
    #endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */

    #if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
    {
        /* Only created when preemption is used. */
        vTimerPeriodicISRTests();
    }
    #endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */

    #if( configSTART_INTERRUPT_QUEUE_TESTS == 1 )
    {
        portYIELD_FROM_ISR( xFirstTimerHandler() );
    }
    #endif /* configSTART_INTERRUPT_QUEUE_TESTS */
}
/*-----------------------------------------------------------*/

static void prvCheckTask( void *pvParameters )
{
TickType_t xNextWakeTime;
TickType_t xCycleFrequency = mainNO_ERROR_CHECK_TASK_PERIOD;
char * const pcPassMessage = mainDEMO_SUCCESS_MESSAGE;
char * pcStatusMessage = pcPassMessage;
extern void vToggleLED( void );

    /* Silence compiler warnings about unused variables. */
    ( void ) pvParameters;

    /* Demo start marker. */
    configPRINT_STRING( "FreeRTOS Demo Start\r\n" );

    /* Initialise xNextWakeTime - this only needs to be done once. */
    xNextWakeTime = xTaskGetTickCount();

    for( ;; )
    {
        /* Place this task in the blocked state until it is time to run again. */
        vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );

        #if( configSTART_TASK_NOTIFY_TESTS == 1 )
        {
            if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR:  Notification.\r\n";
            }
        }
        #endif /* configSTART_TASK_NOTIFY_TESTS */

        #if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
        {
            if( xAreTaskNotificationArrayTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR:  Notification Array.\r\n";
            }
        }
        #endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */

        #if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
        {
            if( xAreBlockingQueuesStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: BlockQueue.\r\n";
            }
        }
        #endif /* configSTART_BLOCKING_QUEUE_TESTS */

        #if( configSTART_SEMAPHORE_TESTS == 1 )
        {
            if( xAreSemaphoreTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: SemTest.\r\n";
            }
        }
        #endif /* configSTART_SEMAPHORE_TESTS */

        #if( configSTART_POLLED_QUEUE_TESTS == 1 )
        {
            if( xArePollingQueuesStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: PollQueue.\r\n";
            }
        }
        #endif /* configSTART_POLLED_QUEUE_TESTS */

        #if( configSTART_INTEGER_MATH_TESTS == 1 )
        {
            if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: IntMath.\r\n";
            }
        }
        #endif /* configSTART_INTEGER_MATH_TESTS */

        #if( configSTART_GENERIC_QUEUE_TESTS == 1 )
        {
            if( xAreGenericQueueTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: GenQueue.\r\n";
            }
        }
        #endif /* configSTART_GENERIC_QUEUE_TESTS */

        #if( configSTART_PEEK_QUEUE_TESTS == 1 )
        {
            if( xAreQueuePeekTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: QueuePeek.\r\n";
            }
        }
        #endif /* configSTART_PEEK_QUEUE_TESTS */

        #if( configSTART_MATH_TESTS == 1 )
        {
            if( xAreMathsTaskStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Flop.\r\n";
            }
        }
        #endif /* configSTART_MATH_TESTS */

        #if( configSTART_RECURSIVE_MUTEX_TESTS == 1 )
        {
            if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: RecMutex.\r\n";
            }
        }
        #endif /* configSTART_RECURSIVE_MUTEX_TESTS */

        #if( configSTART_COUNTING_SEMAPHORE_TESTS == 1 )
        {
            if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: CountSem.\r\n";
            }
        }
        #endif /* configSTART_COUNTING_SEMAPHORE_TESTS */

        #if( configSTART_QUEUE_SET_TESTS == 1 )
        {
            if( xAreQueueSetTasksStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Queue set.\r\n";
            }
        }
        #endif /* configSTART_QUEUE_SET_TESTS */

        #if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
        {
            if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Queue overwrite.\r\n";
            }
        }
        #endif /* configSTART_QUEUE_OVERWRITE_TESTS */

        #if( configSTART_EVENT_GROUP_TESTS == 1 )
        {
            if( xAreEventGroupTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: EventGroup.\r\n";
            }
        }
        #endif /* configSTART_EVENT_GROUP_TESTS */

        #if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
        {
            if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: IntSem.\r\n";
            }
        }
        #endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */

        #if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
        {
            if( xAreQueueSetPollTasksStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Queue set polling.\r\n";
            }
        }
        #endif /* configSTART_QUEUE_SET_POLLING_TESTS */

        #if( configSTART_BLOCK_TIME_TESTS == 1 )
        {
            if( xAreBlockTimeTestTasksStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Block time.\r\n";
            }
        }
        #endif /* configSTART_BLOCK_TIME_TESTS */

        #if( configSTART_ABORT_DELAY_TESTS == 1 )
        {
            if( xAreAbortDelayTestTasksStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Abort delay.\r\n";
            }
        }
        #endif /* configSTART_ABORT_DELAY_TESTS */

        #if( configSTART_MESSAGE_BUFFER_TESTS == 1 )
        {
            if( xAreMessageBufferTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR:  MessageBuffer.\r\n";
            }
        }
        #endif /* configSTART_MESSAGE_BUFFER_TESTS */

        #if( configSTART_STREAM_BUFFER_TESTS == 1 )
        {
            if( xAreStreamBufferTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR:  StreamBuffer.\r\n";
            }
        }
        #endif /* configSTART_STREAM_BUFFER_TESTS */

        #if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
        {
            if( xIsInterruptStreamBufferDemoStillRunning() != pdPASS )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer interrupt.\r\n";
            }
        }
        #endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */

        #if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
        {
            if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: TimerDemo.\r\n";
            }
        }
        #endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */

        #if( configSTART_INTERRUPT_QUEUE_TESTS == 1 )
        {
            if( xAreIntQueueTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: IntQueue.\r\n";
            }
        }
        #endif /* configSTART_INTERRUPT_QUEUE_TESTS */

        #if( configSTART_REGISTER_TESTS == 1 )
        {
            if( xAreRegisterTasksStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: RegTests.\r\n";
            }
        }
        #endif /* configSTART_REGISTER_TESTS */

        #if( configSTART_DELETE_SELF_TESTS == 1 )
        {
            if( xIsCreateTaskStillRunning() != pdTRUE )
            {
                pcStatusMessage = "FreeRTOS Demo ERROR: Death.\r\n";
            }
        }
        #endif /* configSTART_DELETE_SELF_TESTS */

        /* Toggle the LED to show the system status if the UART is not
         * connected. */
        vToggleLED();

        /* If an error has been found then increase the LED toggle rate by
         * increasing the cycle frequency. */
        if( pcStatusMessage != pcPassMessage )
        {
            xCycleFrequency = mainERROR_CHECK_TASK_PERIOD;
        }

        configPRINT_STRING( pcStatusMessage );
    }
}
/*-----------------------------------------------------------*/