2 FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.
\r
4 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
6 ***************************************************************************
\r
8 * FreeRTOS provides completely free yet professionally developed, *
\r
9 * robust, strictly quality controlled, supported, and cross *
\r
10 * platform software that has become a de facto standard. *
\r
12 * Help yourself get started quickly and support the FreeRTOS *
\r
13 * project by purchasing a FreeRTOS tutorial book, reference *
\r
14 * manual, or both from: http://www.FreeRTOS.org/Documentation *
\r
18 ***************************************************************************
\r
20 This file is part of the FreeRTOS distribution.
\r
22 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
23 the terms of the GNU General Public License (version 2) as published by the
\r
24 Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
\r
26 >>! NOTE: The modification to the GPL is included to allow you to distribute
\r
27 >>! a combined work that includes FreeRTOS without being obliged to provide
\r
28 >>! the source code for proprietary components outside of the FreeRTOS
\r
31 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
32 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
33 FOR A PARTICULAR PURPOSE. Full license text is available from the following
\r
34 link: http://www.freertos.org/a00114.html
\r
38 ***************************************************************************
\r
40 * Having a problem? Start by reading the FAQ "My application does *
\r
41 * not run, what could be wrong?" *
\r
43 * http://www.FreeRTOS.org/FAQHelp.html *
\r
45 ***************************************************************************
\r
47 http://www.FreeRTOS.org - Documentation, books, training, latest versions,
\r
48 license and Real Time Engineers Ltd. contact details.
\r
50 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
51 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
52 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
54 http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
\r
55 Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
56 licenses offer ticketed support, indemnification and middleware.
\r
58 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
59 engineered and independently SIL3 certified version for use in safety and
\r
60 mission critical applications that require provable dependability.
\r
65 /* ****************************************************************************
\r
66 * This project includes a lot of tasks and tests and is therefore complex.
\r
67 * If you would prefer a much simpler project to get started with then select
\r
68 * the 'Blinky' build configuration within the HEW IDE. The Blinky
\r
69 * configuration builds main-blinky.c in place of this file.
\r
70 * ****************************************************************************
\r
72 * Creates all the demo application tasks, then starts the scheduler. The web
\r
73 * documentation provides more details of the standard demo application tasks,
\r
74 * which provide no particular functionality but do provide a good example of
\r
75 * how to use the FreeRTOS API. The tasks defined in flop.c are included in the
\r
76 * set of standard demo tasks to ensure the floating point unit gets some
\r
79 * In addition to the standard demo tasks, the following tasks and tests are
\r
80 * defined and/or created within this file:
\r
82 * Webserver ("uIP") task - This serves a number of dynamically generated WEB
\r
83 * pages to a standard WEB browser. The IP and MAC addresses are configured by
\r
84 * constants defined at the bottom of FreeRTOSConfig.h. Use either a standard
\r
85 * Ethernet cable to connect through a hug, or a cross over (point to point)
\r
86 * cable to connect directly. Ensure the IP address used is compatible with the
\r
87 * IP address of the machine running the browser - the easiest way to achieve
\r
88 * this is to ensure the first three octets of the IP addresses are the same.
\r
90 * "Reg test" tasks - These fill the registers with known values, then check
\r
91 * that each register still contains its expected value. Each task uses
\r
92 * different values. The tasks run with very low priority so get preempted
\r
93 * very frequently. A check variable is incremented on each iteration of the
\r
94 * test loop. A register containing an unexpected value is indicative of an
\r
95 * error in the context switching mechanism and will result in a branch to a
\r
96 * null loop - which in turn will prevent the check variable from incrementing
\r
97 * any further and allow the check task (described below) to determine that an
\r
98 * error has occurred. The nature of the reg test tasks necessitates that they
\r
99 * are written in assembly code.
\r
101 * "Check" timer - The check software timer period is initially set to five
\r
102 * seconds. The callback function associated with the check software timer
\r
103 * checks that all the standard demo tasks, and the register check tasks, are
\r
104 * not only still executing, but are executing without reporting any errors. If
\r
105 * the check software timer discovers that a task has either stalled, or
\r
106 * reported an error, then it changes its own execution period from the initial
\r
107 * five seconds, to just 200ms. The check software timer callback function
\r
108 * also toggles LED3 each time it is called. This provides a visual indication
\r
109 * of the system status: If LED3 toggles every five seconds, then no issues
\r
110 * have been discovered. If the LED toggles every 200ms, then an issue has been
\r
111 * discovered with at least one task.
\r
113 * "High frequency timer test" - A high frequency periodic interrupt is
\r
114 * generated using a timer - the interrupt is assigned a priority above
\r
115 * configMAX_SYSCALL_INTERRUPT_PRIORITY so should not be effected by anything
\r
116 * the kernel is doing. The frequency and priority of the interrupt, in
\r
117 * combination with other standard tests executed in this demo, should result
\r
118 * in interrupts nesting at least 3 and probably 4 deep. This test is only
\r
119 * included in build configurations that have the optimiser switched on. In
\r
120 * optimised builds the count of high frequency ticks is used as the time base
\r
121 * for the run time stats.
\r
123 * *NOTE 1* If LED3 is toggling every 5 seconds then all the demo application
\r
124 * tasks are executing as expected and no errors have been reported in any
\r
125 * tasks. The toggle rate increasing to 200ms indicates that at least one task
\r
126 * has reported unexpected behaviour.
\r
128 * *NOTE 2* vApplicationSetupTimerInterrupt() is called by the kernel to let
\r
129 * the application set up a timer to generate the tick interrupt. In this
\r
130 * example a compare match timer is used for this purpose.
\r
132 * *NOTE 3* The CPU must be in Supervisor mode when the scheduler is started.
\r
133 * The PowerON_Reset_PC() supplied in resetprg.c with this demo has
\r
134 * Change_PSW_PM_to_UserMode() commented out to ensure this is the case.
\r
136 * *NOTE 4* The IntQueue common demo tasks test interrupt nesting and make use
\r
137 * of all the 8bit timers (as two cascaded 16bit units).
\r
142 #include <string.h>
\r
144 /* Kernel includes. */
\r
145 #include "FreeRTOS.h"
\r
147 #include "timers.h"
\r
148 #include "semphr.h"
\r
150 /* Standard demo includes. */
\r
151 #include "partest.h"
\r
152 #include "flash_timer.h"
\r
153 #include "IntQueue.h"
\r
154 #include "BlockQ.h"
\r
156 #include "integer.h"
\r
157 #include "blocktim.h"
\r
158 #include "semtest.h"
\r
160 #include "GenQTest.h"
\r
162 #include "recmutex.h"
\r
165 /* Values that are passed into the reg test tasks using the task parameter. The
\r
166 tasks check that the values are passed in correctly. */
\r
167 #define mainREG_TEST_1_PARAMETER ( 0x12121212UL )
\r
168 #define mainREG_TEST_2_PARAMETER ( 0x12345678UL )
\r
170 /* Priorities at which the tasks are created. */
\r
171 #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
\r
172 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
173 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
174 #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
175 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
176 #define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
177 #define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
178 #define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
179 #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
181 /* The WEB server uses string handling functions, which in turn use a bit more
\r
182 stack than most of the other tasks. */
\r
183 #define mainuIP_STACK_SIZE ( configMINIMAL_STACK_SIZE * 3 )
\r
185 /* The LED toggled by the check timer. */
\r
186 #define mainCHECK_LED ( 3 )
\r
188 /* The rate at which mainCHECK_LED will toggle when all the tasks are running
\r
189 without error. Controlled by the check timer as described at the top of this
\r
191 #define mainNO_ERROR_CHECK_TIMER_PERIOD_MS ( 5000 / portTICK_RATE_MS )
\r
193 /* The rate at which mainCHECK_LED will toggle when an error has been reported
\r
194 by at least one task. Controlled by the check timer as described at the top of
\r
196 #define mainERROR_CHECK_TIMER_PERIOD_MS ( 200 / portTICK_RATE_MS )
\r
198 /* A block time of zero simply means "don't block". */
\r
199 #define mainDONT_BLOCK ( 0UL )
\r
201 /* A set of timers are created, each of which toggles and LED. This specifies
\r
202 the number of timers to create. */
\r
203 #define mainNUMBER_OF_LEDS_TO_FLASH ( 3 )
\r
206 * vApplicationMallocFailedHook() will only be called if
\r
207 * configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
\r
208 * function that will execute if a call to pvPortMalloc() fails.
\r
209 * pvPortMalloc() is called internally by the kernel whenever a task, queue or
\r
210 * semaphore is created. It is also called by various parts of the demo
\r
213 void vApplicationMallocFailedHook( void );
\r
216 * vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set to 1
\r
217 * in FreeRTOSConfig.h. It is a hook function that is called on each iteration
\r
218 * of the idle task. It is essential that code added to this hook function
\r
219 * never attempts to block in any way (for example, call xQueueReceive() with
\r
220 * a block time specified). If the application makes use of the vTaskDelete()
\r
221 * API function (as this demo application does) then it is also important that
\r
222 * vApplicationIdleHook() is permitted to return to its calling function because
\r
223 * it is the responsibility of the idle task to clean up memory allocated by the
\r
224 * kernel to any task that has since been deleted.
\r
226 void vApplicationIdleHook( void );
\r
229 * vApplicationStackOverflowHook() will only be called if
\r
230 * configCHECK_FOR_STACK_OVERFLOW is set to a non-zero value. The handle and
\r
231 * name of the offending task should be passed in the function parameters, but
\r
232 * it is possible that the stack overflow will have corrupted these - in which
\r
233 * case pxCurrentTCB can be inspected to find the same information.
\r
235 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );
\r
238 * The reg test tasks as described at the top of this file.
\r
240 static void prvRegTest1Task( void *pvParameters );
\r
241 static void prvRegTest2Task( void *pvParameters );
\r
244 * The actual implementation of the reg test functionality, which, because of
\r
245 * the direct register access, have to be in assembly.
\r
247 static void prvRegTest1Implementation( void );
\r
248 static void prvRegTest2Implementation( void );
\r
251 * The check timer callback function, as described at the top of this file.
\r
253 static void prvCheckTimerCallback( xTimerHandle xTimer );
\r
256 * Contains the implementation of the WEB server.
\r
258 extern void vuIP_Task( void *pvParameters );
\r
260 /*-----------------------------------------------------------*/
\r
262 /* Variables that are incremented on each iteration of the reg test tasks -
\r
263 provided the tasks have not reported any errors. The check task inspects these
\r
264 variables to ensure they are still incrementing as expected. If a variable
\r
265 stops incrementing then it is likely that its associate task has stalled. */
\r
266 unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;
\r
268 /* The status message that is displayed at the bottom of the "task stats" web
\r
269 page, which is served by the uIP task. This will report any errors picked up
\r
270 by the reg test task. */
\r
271 const char *pcStatusMessage = "All tasks executing without error.";
\r
273 /*-----------------------------------------------------------*/
\r
277 xTimerHandle xCheckTimer;
\r
278 extern void HardwareSetup( void );
\r
280 /* Turn all LEDs off. */
\r
281 vParTestInitialise();
\r
283 /* Start the reg test tasks which test the context switching mechanism. */
\r
284 xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
285 xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
287 /* The web server task. */
\r
288 xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );
\r
290 /* Create the standard demo tasks. */
\r
291 vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
\r
292 vCreateBlockTimeTasks();
\r
293 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
294 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
295 vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
\r
296 vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
\r
297 vStartQueuePeekTasks();
\r
298 vStartRecursiveMutexTasks();
\r
299 vStartInterruptQueueTasks();
\r
300 vStartMathTasks( mainFLOP_TASK_PRIORITY );
\r
302 /* Create the timers used to toggle the LEDs. */
\r
303 vStartLEDFlashTimers( mainNUMBER_OF_LEDS_TO_FLASH );
\r
305 /* Create the software timer that performs the 'check' functionality,
\r
306 as described at the top of this file. */
\r
307 xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */
\r
308 ( mainNO_ERROR_CHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */
\r
309 pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
\r
310 ( void * ) 0, /* The ID is not used, so can be set to anything. */
\r
311 prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */
\r
314 if( xCheckTimer != NULL )
\r
316 xTimerStart( xCheckTimer, mainDONT_BLOCK );
\r
319 /* The suicide tasks must be created last as they need to know how many
\r
320 tasks were running prior to their creation in order to ascertain whether
\r
321 or not the correct/expected number of tasks are running at any given time. */
\r
322 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
324 /* Start the tasks running. */
\r
325 vTaskStartScheduler();
\r
327 /* If all is well, the scheduler will now be running, and the following line
\r
328 will never be reached. If the following line does execute, then there was
\r
329 insufficient FreeRTOS heap memory available for the idle and/or timer tasks
\r
330 to be created. See the memory management section on the FreeRTOS web site
\r
331 for more details. */
\r
334 /*-----------------------------------------------------------*/
\r
336 static void prvCheckTimerCallback( xTimerHandle xTimer )
\r
338 static long lChangedTimerPeriodAlready = pdFALSE;
\r
339 static unsigned long ulLastRegTest1CycleCount = 0, ulLastRegTest2CycleCount = 0;
\r
340 long lErrorFound = pdFALSE;
\r
342 /* If this is being executed then the kernel has been started. Start the
\r
343 high frequency timer test as described at the top of this file. This is
\r
344 only included in the optimised build configuration - otherwise it takes up
\r
345 too much CPU time and can disrupt other tests. */
\r
346 #ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST
\r
347 vSetupHighFrequencyTimer();
\r
350 /* Check the standard demo tasks are running without error. */
\r
351 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
353 lErrorFound = pdTRUE;
\r
354 pcStatusMessage = "Error: GenQueue";
\r
356 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
358 lErrorFound = pdTRUE;
\r
359 pcStatusMessage = "Error: QueuePeek";
\r
361 else if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
363 lErrorFound = pdTRUE;
\r
364 pcStatusMessage = "Error: BlockQueue";
\r
366 else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
368 lErrorFound = pdTRUE;
\r
369 pcStatusMessage = "Error: BlockTime";
\r
371 else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
373 lErrorFound = pdTRUE;
\r
374 pcStatusMessage = "Error: SemTest";
\r
376 else if( xArePollingQueuesStillRunning() != pdTRUE )
\r
378 lErrorFound = pdTRUE;
\r
379 pcStatusMessage = "Error: PollQueue";
\r
381 else if( xIsCreateTaskStillRunning() != pdTRUE )
\r
383 lErrorFound = pdTRUE;
\r
384 pcStatusMessage = "Error: Death";
\r
386 else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
388 lErrorFound = pdTRUE;
\r
389 pcStatusMessage = "Error: IntMath";
\r
391 else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
393 lErrorFound = pdTRUE;
\r
394 pcStatusMessage = "Error: RecMutex";
\r
396 else if( xAreIntQueueTasksStillRunning() != pdPASS )
\r
398 lErrorFound = pdTRUE;
\r
399 pcStatusMessage = "Error: IntQueue";
\r
401 else if( xAreMathsTaskStillRunning() != pdPASS )
\r
403 lErrorFound = pdTRUE;
\r
404 pcStatusMessage = "Error: Flop";
\r
407 /* Check the reg test tasks are still cycling. They will stop incrementing
\r
408 their loop counters if they encounter an error. */
\r
409 if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
\r
411 lErrorFound = pdTRUE;
\r
412 pcStatusMessage = "Error: RegTest1";
\r
415 if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )
\r
417 lErrorFound = pdTRUE;
\r
418 pcStatusMessage = "Error: RegTest2";
\r
421 ulLastRegTest1CycleCount = ulRegTest1CycleCount;
\r
422 ulLastRegTest2CycleCount = ulRegTest2CycleCount;
\r
424 /* Toggle the check LED to give an indication of the system status. If
\r
425 the LED toggles every mainNO_ERROR_CHECK_TIMER_PERIOD_MS milliseconds then
\r
426 everything is ok. A faster toggle indicates an error. */
\r
427 vParTestToggleLED( mainCHECK_LED );
\r
429 /* Have any errors been latch in lErrorFound? If so, shorten the
\r
430 period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
\r
431 This will result in an increase in the rate at which mainCHECK_LED
\r
433 if( lErrorFound != pdFALSE )
\r
435 if( lChangedTimerPeriodAlready == pdFALSE )
\r
437 lChangedTimerPeriodAlready = pdTRUE;
\r
439 /* This call to xTimerChangePeriod() uses a zero block time.
\r
440 Functions called from inside of a timer callback function must
\r
441 *never* attempt to block. */
\r
442 xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
\r
446 /*-----------------------------------------------------------*/
\r
448 /* The RX port uses this callback function to configure its tick interrupt.
\r
449 This allows the application to choose the tick interrupt source. */
\r
450 void vApplicationSetupTimerInterrupt( void )
\r
452 /* Enable compare match timer 0. */
\r
455 /* Interrupt on compare match. */
\r
456 CMT0.CMCR.BIT.CMIE = 1;
\r
458 /* Set the compare match value. */
\r
459 CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );
\r
461 /* Divide the PCLK by 8. */
\r
462 CMT0.CMCR.BIT.CKS = 0;
\r
464 /* Enable the interrupt... */
\r
465 _IEN( _CMT0_CMI0 ) = 1;
\r
467 /* ...and set its priority to the application defined kernel priority. */
\r
468 _IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;
\r
470 /* Start the timer. */
\r
471 CMT.CMSTR0.BIT.STR0 = 1;
\r
473 /*-----------------------------------------------------------*/
\r
475 /* This function is explained by the comments above its prototype at the top
\r
477 void vApplicationMallocFailedHook( void )
\r
481 /*-----------------------------------------------------------*/
\r
483 /* This function is explained by the comments above its prototype at the top
\r
485 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
\r
489 /*-----------------------------------------------------------*/
\r
491 /* This function is explained by the comments above its prototype at the top
\r
493 void vApplicationIdleHook( void )
\r
496 /*-----------------------------------------------------------*/
\r
498 /* This function is explained in the comments at the top of this file. */
\r
499 static void prvRegTest1Task( void *pvParameters )
\r
501 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_1_PARAMETER )
\r
503 /* The parameter did not contain the expected value. */
\r
506 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
507 taskDISABLE_INTERRUPTS();
\r
511 /* This is an inline asm function that never returns. */
\r
512 prvRegTest1Implementation();
\r
514 /*-----------------------------------------------------------*/
\r
516 /* This function is explained in the comments at the top of this file. */
\r
517 static void prvRegTest2Task( void *pvParameters )
\r
519 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_2_PARAMETER )
\r
521 /* The parameter did not contain the expected value. */
\r
524 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
525 taskDISABLE_INTERRUPTS();
\r
529 /* This is an inline asm function that never returns. */
\r
530 prvRegTest2Implementation();
\r
532 /*-----------------------------------------------------------*/
\r
534 /* This function is explained in the comments at the top of this file. */
\r
535 #pragma inline_asm prvRegTest1Implementation
\r
536 static void prvRegTest1Implementation( void )
\r
538 ; Put a known value in each register.
\r
555 ; Loop, checking each itteration that each register still contains the
\r
559 ; Push the registers that are going to get clobbered.
\r
562 ; Increment the loop counter to show this task is still getting CPU time.
\r
563 MOV.L #_ulRegTest1CycleCount, R14
\r
568 ; Yield to extend the text coverage. Set the bit in the ITU SWINTR register.
\r
570 MOV.L #0872E0H, R15
\r
575 ; Restore the clobbered registers.
\r
578 ; Now compare each register to ensure it still contains the value that was
\r
579 ; set before this loop was entered.
\r
611 ; All comparisons passed, start a new itteratio of this loop.
\r
615 ; A compare failed, just loop here so the loop counter stops incrementing
\r
616 ; causing the check task to indicate the error.
\r
619 /*-----------------------------------------------------------*/
\r
621 /* This function is explained in the comments at the top of this file. */
\r
622 #pragma inline_asm prvRegTest2Implementation
\r
623 static void prvRegTest2Implementation( void )
\r
625 ; Put a known value in each register.
\r
642 ; Loop, checking on each itteration that each register still contains the
\r
646 ; Push the registers that are going to get clobbered.
\r
649 ; Increment the loop counter to show this task is still getting CPU time.
\r
650 MOV.L #_ulRegTest2CycleCount, R14
\r
655 ; Restore the clobbered registers.
\r
689 ; All comparisons passed, start a new itteratio of this loop.
\r
693 ; A compare failed, just loop here so the loop counter stops incrementing
\r
694 ; - causing the check task to indicate the error.
\r
697 /*-----------------------------------------------------------*/
\r
699 char *pcGetTaskStatusMessage( void )
\r
701 /* Not bothered about a critical section here although technically because of
\r
702 the task priorities the pointer could change it will be atomic if not near
\r
703 atomic and its not critical. */
\r
704 return ( char * ) pcStatusMessage;
\r
706 /*-----------------------------------------------------------*/
\r