2 FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
\r
5 ***************************************************************************
\r
7 * FreeRTOS tutorial books are available in pdf and paperback. *
\r
8 * Complete, revised, and edited pdf reference manuals are also *
\r
11 * Purchasing FreeRTOS documentation will not only help you, by *
\r
12 * ensuring you get running as quickly as possible and with an *
\r
13 * in-depth knowledge of how to use FreeRTOS, it will also help *
\r
14 * the FreeRTOS project to continue with its mission of providing *
\r
15 * professional grade, cross platform, de facto standard solutions *
\r
16 * for microcontrollers - completely free of charge! *
\r
18 * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
\r
20 * Thank you for using FreeRTOS, and thank you for your support! *
\r
22 ***************************************************************************
\r
25 This file is part of the FreeRTOS distribution.
\r
27 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
28 the terms of the GNU General Public License (version 2) as published by the
\r
29 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
\r
30 >>>NOTE<<< The modification to the GPL is included to allow you to
\r
31 distribute a combined work that includes FreeRTOS without being obliged to
\r
32 provide the source code for proprietary components outside of the FreeRTOS
\r
33 kernel. FreeRTOS is distributed in the hope that it will be useful, but
\r
34 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
35 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
36 more details. You should have received a copy of the GNU General Public
\r
37 License and the FreeRTOS license exception along with FreeRTOS; if not it
\r
38 can be viewed here: http://www.freertos.org/a00114.html and also obtained
\r
39 by writing to Richard Barry, contact details for whom are available on the
\r
44 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
47 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
50 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
51 licensing and training services.
\r
54 /* ****************************************************************************
\r
55 * This project includes a lot of tasks and tests and is therefore complex.
\r
56 * If you would prefer a much simpler project to get started with then select
\r
57 * the 'Blinky' build configuration within the HEW IDE. The Blinky
\r
58 * configuration builds main-blinky.c in place of this file.
\r
59 * ****************************************************************************
\r
61 * Creates all the demo application tasks, then starts the scheduler. The web
\r
62 * documentation provides more details of the standard demo application tasks,
\r
63 * which provide no particular functionality but do provide a good example of
\r
64 * how to use the FreeRTOS API. The tasks defined in flop.c are included in the
\r
65 * set of standard demo tasks to ensure the floating point unit gets some
\r
68 * In addition to the standard demo tasks, the following tasks and tests are
\r
69 * defined and/or created within this file:
\r
71 * Webserver ("uIP") task - This serves a number of dynamically generated WEB
\r
72 * pages to a standard WEB browser. The IP and MAC addresses are configured by
\r
73 * constants defined at the bottom of FreeRTOSConfig.h. Use either a standard
\r
74 * Ethernet cable to connect through a hug, or a cross over (point to point)
\r
75 * cable to connect directly. Ensure the IP address used is compatible with the
\r
76 * IP address of the machine running the browser - the easiest way to achieve
\r
77 * this is to ensure the first three octets of the IP addresses are the same.
\r
79 * "Reg test" tasks - These fill the registers with known values, then check
\r
80 * that each register still contains its expected value. Each task uses
\r
81 * different values. The tasks run with very low priority so get preempted
\r
82 * very frequently. A check variable is incremented on each iteration of the
\r
83 * test loop. A register containing an unexpected value is indicative of an
\r
84 * error in the context switching mechanism and will result in a branch to a
\r
85 * null loop - which in turn will prevent the check variable from incrementing
\r
86 * any further and allow the check task (described below) to determine that an
\r
87 * error has occurred. The nature of the reg test tasks necessitates that they
\r
88 * are written in assembly code.
\r
90 * "Check" timer - The check software timer period is initially set to five
\r
91 * seconds. The callback function associated with the check software timer
\r
92 * checks that all the standard demo tasks, and the register check tasks, are
\r
93 * not only still executing, but are executing without reporting any errors. If
\r
94 * the check software timer discovers that a task has either stalled, or
\r
95 * reported an error, then it changes its own execution period from the initial
\r
96 * five seconds, to just 200ms. The check software timer callback function
\r
97 * also toggles LED3 each time it is called. This provides a visual indication
\r
98 * of the system status: If LED3 toggles every five seconds, then no issues
\r
99 * have been discovered. If the LED toggles every 200ms, then an issue has been
\r
100 * discovered with at least one task.
\r
102 * "High frequency timer test" - A high frequency periodic interrupt is
\r
103 * generated using a timer - the interrupt is assigned a priority above
\r
104 * configMAX_SYSCALL_INTERRUPT_PRIORITY so should not be effected by anything
\r
105 * the kernel is doing. The frequency and priority of the interrupt, in
\r
106 * combination with other standard tests executed in this demo, should result
\r
107 * in interrupts nesting at least 3 and probably 4 deep. This test is only
\r
108 * included in build configurations that have the optimiser switched on. In
\r
109 * optimised builds the count of high frequency ticks is used as the time base
\r
110 * for the run time stats.
\r
112 * *NOTE 1* If LED3 is toggling every 5 seconds then all the demo application
\r
113 * tasks are executing as expected and no errors have been reported in any
\r
114 * tasks. The toggle rate increasing to 200ms indicates that at least one task
\r
115 * has reported unexpected behaviour.
\r
117 * *NOTE 2* vApplicationSetupTimerInterrupt() is called by the kernel to let
\r
118 * the application set up a timer to generate the tick interrupt. In this
\r
119 * example a compare match timer is used for this purpose.
\r
121 * *NOTE 3* The CPU must be in Supervisor mode when the scheduler is started.
\r
122 * The PowerON_Reset_PC() supplied in resetprg.c with this demo has
\r
123 * Change_PSW_PM_to_UserMode() commented out to ensure this is the case.
\r
125 * *NOTE 4* The IntQueue common demo tasks test interrupt nesting and make use
\r
126 * of all the 8bit timers (as two cascaded 16bit units).
\r
131 #include <string.h>
\r
133 /* Hardware specific includes. */
\r
134 #include "iodefine.h"
\r
136 /* Kernel includes. */
\r
137 #include "FreeRTOS.h"
\r
139 #include "timers.h"
\r
140 #include "semphr.h"
\r
142 /* Standard demo includes. */
\r
143 #include "partest.h"
\r
144 #include "flash_timer.h"
\r
145 #include "IntQueue.h"
\r
146 #include "BlockQ.h"
\r
148 #include "integer.h"
\r
149 #include "blocktim.h"
\r
150 #include "semtest.h"
\r
152 #include "GenQTest.h"
\r
154 #include "recmutex.h"
\r
157 /* Values that are passed into the reg test tasks using the task parameter. The
\r
158 tasks check that the values are passed in correctly. */
\r
159 #define mainREG_TEST_1_PARAMETER ( 0x12121212UL )
\r
160 #define mainREG_TEST_2_PARAMETER ( 0x12345678UL )
\r
162 /* Priorities at which the tasks are created. */
\r
163 #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
\r
164 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
165 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
166 #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
167 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
168 #define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
169 #define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
170 #define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
171 #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
173 /* The WEB server uses string handling functions, which in turn use a bit more
\r
174 stack than most of the other tasks. */
\r
175 #define mainuIP_STACK_SIZE ( configMINIMAL_STACK_SIZE * 3 )
\r
177 /* The LED toggled by the check timer. */
\r
178 #define mainCHECK_LED ( 3 )
\r
180 /* The rate at which mainCHECK_LED will toggle when all the tasks are running
\r
181 without error. Controlled by the check timer as described at the top of this
\r
183 #define mainNO_ERROR_CHECK_TIMER_PERIOD_MS ( 5000 / portTICK_RATE_MS )
\r
185 /* The rate at which mainCHECK_LED will toggle when an error has been reported
\r
186 by at least one task. Controlled by the check timer as described at the top of
\r
188 #define mainERROR_CHECK_TIMER_PERIOD_MS ( 200 / portTICK_RATE_MS )
\r
190 /* A block time of zero simply means "don't block". */
\r
191 #define mainDONT_BLOCK ( 0UL )
\r
193 /* A set of timers are created, each of which toggles and LED. This specifies
\r
194 the number of timers to create. */
\r
195 #define mainNUMBER_OF_LEDS_TO_FLASH ( 3 )
\r
198 * vApplicationMallocFailedHook() will only be called if
\r
199 * configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
\r
200 * function that will execute if a call to pvPortMalloc() fails.
\r
201 * pvPortMalloc() is called internally by the kernel whenever a task, queue or
\r
202 * semaphore is created. It is also called by various parts of the demo
\r
205 void vApplicationMallocFailedHook( void );
\r
208 * vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set to 1
\r
209 * in FreeRTOSConfig.h. It is a hook function that is called on each iteration
\r
210 * of the idle task. It is essential that code added to this hook function
\r
211 * never attempts to block in any way (for example, call xQueueReceive() with
\r
212 * a block time specified). If the application makes use of the vTaskDelete()
\r
213 * API function (as this demo application does) then it is also important that
\r
214 * vApplicationIdleHook() is permitted to return to its calling function because
\r
215 * it is the responsibility of the idle task to clean up memory allocated by the
\r
216 * kernel to any task that has since been deleted.
\r
218 void vApplicationIdleHook( void );
\r
221 * vApplicationStackOverflowHook() will only be called if
\r
222 * configCHECK_FOR_STACK_OVERFLOW is set to a non-zero value. The handle and
\r
223 * name of the offending task should be passed in the function parameters, but
\r
224 * it is possible that the stack overflow will have corrupted these - in which
\r
225 * case pxCurrentTCB can be inspected to find the same information.
\r
227 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );
\r
230 * The reg test tasks as described at the top of this file.
\r
232 static void prvRegTest1Task( void *pvParameters );
\r
233 static void prvRegTest2Task( void *pvParameters );
\r
236 * The actual implementation of the reg test functionality, which, because of
\r
237 * the direct register access, have to be in assembly.
\r
239 static void prvRegTest1Implementation( void );
\r
240 static void prvRegTest2Implementation( void );
\r
243 * The check timer callback function, as described at the top of this file.
\r
245 static void prvCheckTimerCallback( xTimerHandle xTimer );
\r
248 * Contains the implementation of the WEB server.
\r
250 extern void vuIP_Task( void *pvParameters );
\r
252 /*-----------------------------------------------------------*/
\r
254 /* Variables that are incremented on each iteration of the reg test tasks -
\r
255 provided the tasks have not reported any errors. The check task inspects these
\r
256 variables to ensure they are still incrementing as expected. If a variable
\r
257 stops incrementing then it is likely that its associate task has stalled. */
\r
258 unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;
\r
260 /* The status message that is displayed at the bottom of the "task stats" web
\r
261 page, which is served by the uIP task. This will report any errors picked up
\r
262 by the reg test task. */
\r
263 const char *pcStatusMessage = "All tasks executing without error.";
\r
265 /*-----------------------------------------------------------*/
\r
269 xTimerHandle xCheckTimer;
\r
270 extern void HardwareSetup( void );
\r
272 /* Turn all LEDs off. */
\r
273 vParTestInitialise();
\r
275 /* Start the reg test tasks which test the context switching mechanism. */
\r
276 xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
277 xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
279 /* The web server task. NOTE: COMMENTED OUT AS THE ETHERNET PORT IS NOT
\r
280 YET BEING CONFIGURED IN hwsetup.c. */
\r
281 //xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );
\r
283 /* Create the standard demo tasks. */
\r
284 vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
\r
285 vCreateBlockTimeTasks();
\r
286 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
287 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
288 vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
\r
289 vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
\r
290 vStartQueuePeekTasks();
\r
291 vStartRecursiveMutexTasks();
\r
292 vStartInterruptQueueTasks();
\r
293 vStartMathTasks( mainFLOP_TASK_PRIORITY );
\r
295 /* Create the timers used to toggle the LEDs. */
\r
296 vStartLEDFlashTimers( mainNUMBER_OF_LEDS_TO_FLASH );
\r
298 /* Create the software timer that performs the 'check' functionality,
\r
299 as described at the top of this file. */
\r
300 xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */
\r
301 ( mainNO_ERROR_CHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */
\r
302 pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
\r
303 ( void * ) 0, /* The ID is not used, so can be set to anything. */
\r
304 prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */
\r
307 if( xCheckTimer != NULL )
\r
309 xTimerStart( xCheckTimer, mainDONT_BLOCK );
\r
312 /* The suicide tasks must be created last as they need to know how many
\r
313 tasks were running prior to their creation in order to ascertain whether
\r
314 or not the correct/expected number of tasks are running at any given time. */
\r
315 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
317 /* Start the tasks running. */
\r
318 vTaskStartScheduler();
\r
320 /* If all is well, the scheduler will now be running, and the following line
\r
321 will never be reached. If the following line does execute, then there was
\r
322 insufficient FreeRTOS heap memory available for the idle and/or timer tasks
\r
323 to be created. See the memory management section on the FreeRTOS web site
\r
324 for more details. */
\r
327 /*-----------------------------------------------------------*/
\r
329 static void prvCheckTimerCallback( xTimerHandle xTimer )
\r
331 static long lChangedTimerPeriodAlready = pdFALSE;
\r
332 static unsigned long ulLastRegTest1CycleCount = 0, ulLastRegTest2CycleCount = 0;
\r
333 long lErrorFound = pdFALSE;
\r
335 /* If this is being executed then the kernel has been started. Start the
\r
336 high frequency timer test as described at the top of this file. This is
\r
337 only included in the optimised build configuration - otherwise it takes up
\r
338 too much CPU time and can disrupt other tests. */
\r
339 #ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST
\r
340 vSetupHighFrequencyTimer();
\r
343 /* Check the standard demo tasks are running without error. */
\r
344 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
346 lErrorFound = pdTRUE;
\r
347 pcStatusMessage = "Error: GenQueue";
\r
349 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
351 lErrorFound = pdTRUE;
\r
352 pcStatusMessage = "Error: QueuePeek";
\r
354 else if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
356 lErrorFound = pdTRUE;
\r
357 pcStatusMessage = "Error: BlockQueue";
\r
359 else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
361 lErrorFound = pdTRUE;
\r
362 pcStatusMessage = "Error: BlockTime";
\r
364 else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
366 lErrorFound = pdTRUE;
\r
367 pcStatusMessage = "Error: SemTest";
\r
369 else if( xArePollingQueuesStillRunning() != pdTRUE )
\r
371 lErrorFound = pdTRUE;
\r
372 pcStatusMessage = "Error: PollQueue";
\r
374 else if( xIsCreateTaskStillRunning() != pdTRUE )
\r
376 lErrorFound = pdTRUE;
\r
377 pcStatusMessage = "Error: Death";
\r
379 else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
381 lErrorFound = pdTRUE;
\r
382 pcStatusMessage = "Error: IntMath";
\r
384 else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
386 lErrorFound = pdTRUE;
\r
387 pcStatusMessage = "Error: RecMutex";
\r
389 else if( xAreIntQueueTasksStillRunning() != pdPASS )
\r
391 lErrorFound = pdTRUE;
\r
392 pcStatusMessage = "Error: IntQueue";
\r
394 else if( xAreMathsTaskStillRunning() != pdPASS )
\r
396 lErrorFound = pdTRUE;
\r
397 pcStatusMessage = "Error: Flop";
\r
400 /* Check the reg test tasks are still cycling. They will stop incrementing
\r
401 their loop counters if they encounter an error. */
\r
402 if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
\r
404 lErrorFound = pdTRUE;
\r
405 pcStatusMessage = "Error: RegTest1";
\r
408 if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )
\r
410 lErrorFound = pdTRUE;
\r
411 pcStatusMessage = "Error: RegTest2";
\r
414 ulLastRegTest1CycleCount = ulRegTest1CycleCount;
\r
415 ulLastRegTest2CycleCount = ulRegTest2CycleCount;
\r
417 /* Toggle the check LED to give an indication of the system status. If
\r
418 the LED toggles every mainNO_ERROR_CHECK_TIMER_PERIOD_MS milliseconds then
\r
419 everything is ok. A faster toggle indicates an error. */
\r
420 vParTestToggleLED( mainCHECK_LED );
\r
422 /* Have any errors been latch in lErrorFound? If so, shorten the
\r
423 period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
\r
424 This will result in an increase in the rate at which mainCHECK_LED
\r
426 if( lErrorFound != pdFALSE )
\r
428 if( lChangedTimerPeriodAlready == pdFALSE )
\r
430 lChangedTimerPeriodAlready = pdTRUE;
\r
432 /* This call to xTimerChangePeriod() uses a zero block time.
\r
433 Functions called from inside of a timer callback function must
\r
434 *never* attempt to block. */
\r
435 xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
\r
439 /*-----------------------------------------------------------*/
\r
441 /* The RX port uses this callback function to configure its tick interrupt.
\r
442 This allows the application to choose the tick interrupt source. */
\r
443 void vApplicationSetupTimerInterrupt( void )
\r
445 /* Enable compare match timer 0. */
\r
448 /* Interrupt on compare match. */
\r
449 CMT0.CMCR.BIT.CMIE = 1;
\r
451 /* Set the compare match value. */
\r
452 CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );
\r
454 /* Divide the PCLK by 8. */
\r
455 CMT0.CMCR.BIT.CKS = 0;
\r
457 /* Enable the interrupt... */
\r
458 _IEN( _CMT0_CMI0 ) = 1;
\r
460 /* ...and set its priority to the application defined kernel priority. */
\r
461 _IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;
\r
463 /* Start the timer. */
\r
464 CMT.CMSTR0.BIT.STR0 = 1;
\r
466 /*-----------------------------------------------------------*/
\r
468 /* This function is explained by the comments above its prototype at the top
\r
470 void vApplicationMallocFailedHook( void )
\r
474 /*-----------------------------------------------------------*/
\r
476 /* This function is explained by the comments above its prototype at the top
\r
478 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
\r
482 /*-----------------------------------------------------------*/
\r
484 /* This function is explained by the comments above its prototype at the top
\r
486 void vApplicationIdleHook( void )
\r
489 /*-----------------------------------------------------------*/
\r
491 /* This function is explained in the comments at the top of this file. */
\r
492 static void prvRegTest1Task( void *pvParameters )
\r
494 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_1_PARAMETER )
\r
496 /* The parameter did not contain the expected value. */
\r
499 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
500 taskDISABLE_INTERRUPTS();
\r
504 /* This is an inline asm function that never returns. */
\r
505 prvRegTest1Implementation();
\r
507 /*-----------------------------------------------------------*/
\r
509 /* This function is explained in the comments at the top of this file. */
\r
510 static void prvRegTest2Task( void *pvParameters )
\r
512 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_2_PARAMETER )
\r
514 /* The parameter did not contain the expected value. */
\r
517 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
518 taskDISABLE_INTERRUPTS();
\r
522 /* This is an inline asm function that never returns. */
\r
523 prvRegTest2Implementation();
\r
525 /*-----------------------------------------------------------*/
\r
527 /* This function is explained in the comments at the top of this file. */
\r
528 #pragma inline_asm prvRegTest1Implementation
\r
529 static void prvRegTest1Implementation( void )
\r
531 ; Put a known value in each register.
\r
548 ; Loop, checking each itteration that each register still contains the
\r
552 ; Push the registers that are going to get clobbered.
\r
555 ; Increment the loop counter to show this task is still getting CPU time.
\r
556 MOV.L #_ulRegTest1CycleCount, R14
\r
561 ; Yield to extend the text coverage. Set the bit in the ITU SWINTR register.
\r
563 MOV.L #0872E0H, R15
\r
568 ; Restore the clobbered registers.
\r
571 ; Now compare each register to ensure it still contains the value that was
\r
572 ; set before this loop was entered.
\r
604 ; All comparisons passed, start a new itteratio of this loop.
\r
608 ; A compare failed, just loop here so the loop counter stops incrementing
\r
609 ; causing the check task to indicate the error.
\r
612 /*-----------------------------------------------------------*/
\r
614 /* This function is explained in the comments at the top of this file. */
\r
615 #pragma inline_asm prvRegTest2Implementation
\r
616 static void prvRegTest2Implementation( void )
\r
618 ; Put a known value in each register.
\r
635 ; Loop, checking on each itteration that each register still contains the
\r
639 ; Push the registers that are going to get clobbered.
\r
642 ; Increment the loop counter to show this task is still getting CPU time.
\r
643 MOV.L #_ulRegTest2CycleCount, R14
\r
648 ; Restore the clobbered registers.
\r
682 ; All comparisons passed, start a new itteratio of this loop.
\r
686 ; A compare failed, just loop here so the loop counter stops incrementing
\r
687 ; - causing the check task to indicate the error.
\r
690 /*-----------------------------------------------------------*/
\r
692 char *pcGetTaskStatusMessage( void )
\r
694 /* Not bothered about a critical section here although technically because of
\r
695 the task priorities the pointer could change it will be atomic if not near
\r
696 atomic and its not critical. */
\r
697 return ( char * ) pcStatusMessage;
\r
699 /*-----------------------------------------------------------*/
\r