2 FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.
\r
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
7 ***************************************************************************
\r
9 * FreeRTOS provides completely free yet professionally developed, *
\r
10 * robust, strictly quality controlled, supported, and cross *
\r
11 * platform software that has become a de facto standard. *
\r
13 * Help yourself get started quickly and support the FreeRTOS *
\r
14 * project by purchasing a FreeRTOS tutorial book, reference *
\r
15 * manual, or both from: http://www.FreeRTOS.org/Documentation *
\r
19 ***************************************************************************
\r
21 This file is part of the FreeRTOS distribution.
\r
23 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
24 the terms of the GNU General Public License (version 2) as published by the
\r
25 Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
\r
27 >>! NOTE: The modification to the GPL is included to allow you to distribute
\r
28 >>! a combined work that includes FreeRTOS without being obliged to provide
\r
29 >>! the source code for proprietary components outside of the FreeRTOS
\r
32 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
33 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
34 FOR A PARTICULAR PURPOSE. Full license text is available from the following
\r
35 link: http://www.freertos.org/a00114.html
\r
39 ***************************************************************************
\r
41 * Having a problem? Start by reading the FAQ "My application does *
\r
42 * not run, what could be wrong?" *
\r
44 * http://www.FreeRTOS.org/FAQHelp.html *
\r
46 ***************************************************************************
\r
48 http://www.FreeRTOS.org - Documentation, books, training, latest versions,
\r
49 license and Real Time Engineers Ltd. contact details.
\r
51 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
52 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
53 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
55 http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
\r
56 Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
57 licenses offer ticketed support, indemnification and middleware.
\r
59 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
60 engineered and independently SIL3 certified version for use in safety and
\r
61 mission critical applications that require provable dependability.
\r
66 /* ****************************************************************************
\r
67 * This project includes a lot of tasks and tests and is therefore complex.
\r
68 * If you would prefer a much simpler project to get started with then select
\r
69 * the 'Blinky' build configuration within the HEW IDE. The Blinky
\r
70 * configuration builds main-blinky.c in place of this file.
\r
71 * ****************************************************************************
\r
73 * Creates all the demo application tasks, then starts the scheduler. The web
\r
74 * documentation provides more details of the standard demo application tasks,
\r
75 * which provide no particular functionality but do provide a good example of
\r
76 * how to use the FreeRTOS API. The tasks defined in flop.c are included in the
\r
77 * set of standard demo tasks to ensure the floating point unit gets some
\r
80 * In addition to the standard demo tasks, the following tasks and tests are
\r
81 * defined and/or created within this file:
\r
83 * Webserver ("uIP") task - This serves a number of dynamically generated WEB
\r
84 * pages to a standard WEB browser. The IP and MAC addresses are configured by
\r
85 * constants defined at the bottom of FreeRTOSConfig.h. Use either a standard
\r
86 * Ethernet cable to connect through a hug, or a cross over (point to point)
\r
87 * cable to connect directly. Ensure the IP address used is compatible with the
\r
88 * IP address of the machine running the browser - the easiest way to achieve
\r
89 * this is to ensure the first three octets of the IP addresses are the same.
\r
91 * "Reg test" tasks - These fill the registers with known values, then check
\r
92 * that each register still contains its expected value. Each task uses
\r
93 * different values. The tasks run with very low priority so get preempted
\r
94 * very frequently. A check variable is incremented on each iteration of the
\r
95 * test loop. A register containing an unexpected value is indicative of an
\r
96 * error in the context switching mechanism and will result in a branch to a
\r
97 * null loop - which in turn will prevent the check variable from incrementing
\r
98 * any further and allow the check task (described below) to determine that an
\r
99 * error has occurred. The nature of the reg test tasks necessitates that they
\r
100 * are written in assembly code.
\r
102 * "Check" timer - The check software timer period is initially set to five
\r
103 * seconds. The callback function associated with the check software timer
\r
104 * checks that all the standard demo tasks, and the register check tasks, are
\r
105 * not only still executing, but are executing without reporting any errors. If
\r
106 * the check software timer discovers that a task has either stalled, or
\r
107 * reported an error, then it changes its own execution period from the initial
\r
108 * five seconds, to just 200ms. The check software timer callback function
\r
109 * also toggles LED3 each time it is called. This provides a visual indication
\r
110 * of the system status: If LED3 toggles every five seconds, then no issues
\r
111 * have been discovered. If the LED toggles every 200ms, then an issue has been
\r
112 * discovered with at least one task.
\r
114 * "High frequency timer test" - A high frequency periodic interrupt is
\r
115 * generated using a timer - the interrupt is assigned a priority above
\r
116 * configMAX_SYSCALL_INTERRUPT_PRIORITY so should not be effected by anything
\r
117 * the kernel is doing. The frequency and priority of the interrupt, in
\r
118 * combination with other standard tests executed in this demo, should result
\r
119 * in interrupts nesting at least 3 and probably 4 deep. This test is only
\r
120 * included in build configurations that have the optimiser switched on. In
\r
121 * optimised builds the count of high frequency ticks is used as the time base
\r
122 * for the run time stats.
\r
124 * *NOTE 1* If LED3 is toggling every 5 seconds then all the demo application
\r
125 * tasks are executing as expected and no errors have been reported in any
\r
126 * tasks. The toggle rate increasing to 200ms indicates that at least one task
\r
127 * has reported unexpected behaviour.
\r
129 * *NOTE 2* vApplicationSetupTimerInterrupt() is called by the kernel to let
\r
130 * the application set up a timer to generate the tick interrupt. In this
\r
131 * example a compare match timer is used for this purpose.
\r
133 * *NOTE 3* The CPU must be in Supervisor mode when the scheduler is started.
\r
134 * The PowerON_Reset_PC() supplied in resetprg.c with this demo has
\r
135 * Change_PSW_PM_to_UserMode() commented out to ensure this is the case.
\r
137 * *NOTE 4* The IntQueue common demo tasks test interrupt nesting and make use
\r
138 * of all the 8bit timers (as two cascaded 16bit units).
\r
143 #include <string.h>
\r
145 /* Kernel includes. */
\r
146 #include "FreeRTOS.h"
\r
148 #include "timers.h"
\r
149 #include "semphr.h"
\r
151 /* Standard demo includes. */
\r
152 #include "partest.h"
\r
153 #include "flash_timer.h"
\r
154 #include "IntQueue.h"
\r
155 #include "BlockQ.h"
\r
157 #include "integer.h"
\r
158 #include "blocktim.h"
\r
159 #include "semtest.h"
\r
161 #include "GenQTest.h"
\r
163 #include "recmutex.h"
\r
166 /* Values that are passed into the reg test tasks using the task parameter. The
\r
167 tasks check that the values are passed in correctly. */
\r
168 #define mainREG_TEST_1_PARAMETER ( 0x12121212UL )
\r
169 #define mainREG_TEST_2_PARAMETER ( 0x12345678UL )
\r
171 /* Priorities at which the tasks are created. */
\r
172 #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
\r
173 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
174 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
175 #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
176 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
177 #define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
178 #define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
179 #define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
180 #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
182 /* The WEB server uses string handling functions, which in turn use a bit more
\r
183 stack than most of the other tasks. */
\r
184 #define mainuIP_STACK_SIZE ( configMINIMAL_STACK_SIZE * 3 )
\r
186 /* The LED toggled by the check timer. */
\r
187 #define mainCHECK_LED ( 3 )
\r
189 /* The rate at which mainCHECK_LED will toggle when all the tasks are running
\r
190 without error. Controlled by the check timer as described at the top of this
\r
192 #define mainNO_ERROR_CHECK_TIMER_PERIOD_MS ( 5000 / portTICK_RATE_MS )
\r
194 /* The rate at which mainCHECK_LED will toggle when an error has been reported
\r
195 by at least one task. Controlled by the check timer as described at the top of
\r
197 #define mainERROR_CHECK_TIMER_PERIOD_MS ( 200 / portTICK_RATE_MS )
\r
199 /* A block time of zero simply means "don't block". */
\r
200 #define mainDONT_BLOCK ( 0UL )
\r
202 /* A set of timers are created, each of which toggles and LED. This specifies
\r
203 the number of timers to create. */
\r
204 #define mainNUMBER_OF_LEDS_TO_FLASH ( 3 )
\r
207 * vApplicationMallocFailedHook() will only be called if
\r
208 * configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
\r
209 * function that will execute if a call to pvPortMalloc() fails.
\r
210 * pvPortMalloc() is called internally by the kernel whenever a task, queue or
\r
211 * semaphore is created. It is also called by various parts of the demo
\r
214 void vApplicationMallocFailedHook( void );
\r
217 * vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set to 1
\r
218 * in FreeRTOSConfig.h. It is a hook function that is called on each iteration
\r
219 * of the idle task. It is essential that code added to this hook function
\r
220 * never attempts to block in any way (for example, call xQueueReceive() with
\r
221 * a block time specified). If the application makes use of the vTaskDelete()
\r
222 * API function (as this demo application does) then it is also important that
\r
223 * vApplicationIdleHook() is permitted to return to its calling function because
\r
224 * it is the responsibility of the idle task to clean up memory allocated by the
\r
225 * kernel to any task that has since been deleted.
\r
227 void vApplicationIdleHook( void );
\r
230 * vApplicationStackOverflowHook() will only be called if
\r
231 * configCHECK_FOR_STACK_OVERFLOW is set to a non-zero value. The handle and
\r
232 * name of the offending task should be passed in the function parameters, but
\r
233 * it is possible that the stack overflow will have corrupted these - in which
\r
234 * case pxCurrentTCB can be inspected to find the same information.
\r
236 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );
\r
239 * The reg test tasks as described at the top of this file.
\r
241 static void prvRegTest1Task( void *pvParameters );
\r
242 static void prvRegTest2Task( void *pvParameters );
\r
245 * The actual implementation of the reg test functionality, which, because of
\r
246 * the direct register access, have to be in assembly.
\r
248 static void prvRegTest1Implementation( void );
\r
249 static void prvRegTest2Implementation( void );
\r
252 * The check timer callback function, as described at the top of this file.
\r
254 static void prvCheckTimerCallback( xTimerHandle xTimer );
\r
257 * Contains the implementation of the WEB server.
\r
259 extern void vuIP_Task( void *pvParameters );
\r
261 /*-----------------------------------------------------------*/
\r
263 /* Variables that are incremented on each iteration of the reg test tasks -
\r
264 provided the tasks have not reported any errors. The check task inspects these
\r
265 variables to ensure they are still incrementing as expected. If a variable
\r
266 stops incrementing then it is likely that its associate task has stalled. */
\r
267 unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;
\r
269 /* The status message that is displayed at the bottom of the "task stats" web
\r
270 page, which is served by the uIP task. This will report any errors picked up
\r
271 by the reg test task. */
\r
272 const char *pcStatusMessage = "All tasks executing without error.";
\r
274 /*-----------------------------------------------------------*/
\r
278 xTimerHandle xCheckTimer;
\r
279 extern void HardwareSetup( void );
\r
281 /* Turn all LEDs off. */
\r
282 vParTestInitialise();
\r
284 /* Start the reg test tasks which test the context switching mechanism. */
\r
285 xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
286 xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );
\r
288 /* The web server task. */
\r
289 xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );
\r
291 /* Create the standard demo tasks. */
\r
292 vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
\r
293 vCreateBlockTimeTasks();
\r
294 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
295 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
296 vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
\r
297 vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
\r
298 vStartQueuePeekTasks();
\r
299 vStartRecursiveMutexTasks();
\r
300 vStartInterruptQueueTasks();
\r
301 vStartMathTasks( mainFLOP_TASK_PRIORITY );
\r
303 /* Create the timers used to toggle the LEDs. */
\r
304 vStartLEDFlashTimers( mainNUMBER_OF_LEDS_TO_FLASH );
\r
306 /* Create the software timer that performs the 'check' functionality,
\r
307 as described at the top of this file. */
\r
308 xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */
\r
309 ( mainNO_ERROR_CHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */
\r
310 pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
\r
311 ( void * ) 0, /* The ID is not used, so can be set to anything. */
\r
312 prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */
\r
315 if( xCheckTimer != NULL )
\r
317 xTimerStart( xCheckTimer, mainDONT_BLOCK );
\r
320 /* The suicide tasks must be created last as they need to know how many
\r
321 tasks were running prior to their creation in order to ascertain whether
\r
322 or not the correct/expected number of tasks are running at any given time. */
\r
323 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
325 /* Start the tasks running. */
\r
326 vTaskStartScheduler();
\r
328 /* If all is well, the scheduler will now be running, and the following line
\r
329 will never be reached. If the following line does execute, then there was
\r
330 insufficient FreeRTOS heap memory available for the idle and/or timer tasks
\r
331 to be created. See the memory management section on the FreeRTOS web site
\r
332 for more details. */
\r
335 /*-----------------------------------------------------------*/
\r
337 static void prvCheckTimerCallback( xTimerHandle xTimer )
\r
339 static long lChangedTimerPeriodAlready = pdFALSE;
\r
340 static unsigned long ulLastRegTest1CycleCount = 0, ulLastRegTest2CycleCount = 0;
\r
341 long lErrorFound = pdFALSE;
\r
343 /* If this is being executed then the kernel has been started. Start the
\r
344 high frequency timer test as described at the top of this file. This is
\r
345 only included in the optimised build configuration - otherwise it takes up
\r
346 too much CPU time and can disrupt other tests. */
\r
347 #ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST
\r
348 vSetupHighFrequencyTimer();
\r
351 /* Check the standard demo tasks are running without error. */
\r
352 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
354 lErrorFound = pdTRUE;
\r
355 pcStatusMessage = "Error: GenQueue";
\r
357 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
359 lErrorFound = pdTRUE;
\r
360 pcStatusMessage = "Error: QueuePeek";
\r
362 else if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
364 lErrorFound = pdTRUE;
\r
365 pcStatusMessage = "Error: BlockQueue";
\r
367 else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
369 lErrorFound = pdTRUE;
\r
370 pcStatusMessage = "Error: BlockTime";
\r
372 else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
374 lErrorFound = pdTRUE;
\r
375 pcStatusMessage = "Error: SemTest";
\r
377 else if( xArePollingQueuesStillRunning() != pdTRUE )
\r
379 lErrorFound = pdTRUE;
\r
380 pcStatusMessage = "Error: PollQueue";
\r
382 else if( xIsCreateTaskStillRunning() != pdTRUE )
\r
384 lErrorFound = pdTRUE;
\r
385 pcStatusMessage = "Error: Death";
\r
387 else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
389 lErrorFound = pdTRUE;
\r
390 pcStatusMessage = "Error: IntMath";
\r
392 else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
394 lErrorFound = pdTRUE;
\r
395 pcStatusMessage = "Error: RecMutex";
\r
397 else if( xAreIntQueueTasksStillRunning() != pdPASS )
\r
399 lErrorFound = pdTRUE;
\r
400 pcStatusMessage = "Error: IntQueue";
\r
402 else if( xAreMathsTaskStillRunning() != pdPASS )
\r
404 lErrorFound = pdTRUE;
\r
405 pcStatusMessage = "Error: Flop";
\r
408 /* Check the reg test tasks are still cycling. They will stop incrementing
\r
409 their loop counters if they encounter an error. */
\r
410 if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
\r
412 lErrorFound = pdTRUE;
\r
413 pcStatusMessage = "Error: RegTest1";
\r
416 if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )
\r
418 lErrorFound = pdTRUE;
\r
419 pcStatusMessage = "Error: RegTest2";
\r
422 ulLastRegTest1CycleCount = ulRegTest1CycleCount;
\r
423 ulLastRegTest2CycleCount = ulRegTest2CycleCount;
\r
425 /* Toggle the check LED to give an indication of the system status. If
\r
426 the LED toggles every mainNO_ERROR_CHECK_TIMER_PERIOD_MS milliseconds then
\r
427 everything is ok. A faster toggle indicates an error. */
\r
428 vParTestToggleLED( mainCHECK_LED );
\r
430 /* Have any errors been latch in lErrorFound? If so, shorten the
\r
431 period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
\r
432 This will result in an increase in the rate at which mainCHECK_LED
\r
434 if( lErrorFound != pdFALSE )
\r
436 if( lChangedTimerPeriodAlready == pdFALSE )
\r
438 lChangedTimerPeriodAlready = pdTRUE;
\r
440 /* This call to xTimerChangePeriod() uses a zero block time.
\r
441 Functions called from inside of a timer callback function must
\r
442 *never* attempt to block. */
\r
443 xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
\r
447 /*-----------------------------------------------------------*/
\r
449 /* The RX port uses this callback function to configure its tick interrupt.
\r
450 This allows the application to choose the tick interrupt source. */
\r
451 void vApplicationSetupTimerInterrupt( void )
\r
453 /* Enable compare match timer 0. */
\r
456 /* Interrupt on compare match. */
\r
457 CMT0.CMCR.BIT.CMIE = 1;
\r
459 /* Set the compare match value. */
\r
460 CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );
\r
462 /* Divide the PCLK by 8. */
\r
463 CMT0.CMCR.BIT.CKS = 0;
\r
465 /* Enable the interrupt... */
\r
466 _IEN( _CMT0_CMI0 ) = 1;
\r
468 /* ...and set its priority to the application defined kernel priority. */
\r
469 _IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;
\r
471 /* Start the timer. */
\r
472 CMT.CMSTR0.BIT.STR0 = 1;
\r
474 /*-----------------------------------------------------------*/
\r
476 /* This function is explained by the comments above its prototype at the top
\r
478 void vApplicationMallocFailedHook( void )
\r
482 /*-----------------------------------------------------------*/
\r
484 /* This function is explained by the comments above its prototype at the top
\r
486 void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
\r
490 /*-----------------------------------------------------------*/
\r
492 /* This function is explained by the comments above its prototype at the top
\r
494 void vApplicationIdleHook( void )
\r
497 /*-----------------------------------------------------------*/
\r
499 /* This function is explained in the comments at the top of this file. */
\r
500 static void prvRegTest1Task( void *pvParameters )
\r
502 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_1_PARAMETER )
\r
504 /* The parameter did not contain the expected value. */
\r
507 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
508 taskDISABLE_INTERRUPTS();
\r
512 /* This is an inline asm function that never returns. */
\r
513 prvRegTest1Implementation();
\r
515 /*-----------------------------------------------------------*/
\r
517 /* This function is explained in the comments at the top of this file. */
\r
518 static void prvRegTest2Task( void *pvParameters )
\r
520 if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_2_PARAMETER )
\r
522 /* The parameter did not contain the expected value. */
\r
525 /* Stop the tick interrupt so its obvious something has gone wrong. */
\r
526 taskDISABLE_INTERRUPTS();
\r
530 /* This is an inline asm function that never returns. */
\r
531 prvRegTest2Implementation();
\r
533 /*-----------------------------------------------------------*/
\r
535 /* This function is explained in the comments at the top of this file. */
\r
536 #pragma inline_asm prvRegTest1Implementation
\r
537 static void prvRegTest1Implementation( void )
\r
539 ; Put a known value in each register.
\r
556 ; Loop, checking each itteration that each register still contains the
\r
560 ; Push the registers that are going to get clobbered.
\r
563 ; Increment the loop counter to show this task is still getting CPU time.
\r
564 MOV.L #_ulRegTest1CycleCount, R14
\r
569 ; Yield to extend the text coverage. Set the bit in the ITU SWINTR register.
\r
571 MOV.L #0872E0H, R15
\r
576 ; Restore the clobbered registers.
\r
579 ; Now compare each register to ensure it still contains the value that was
\r
580 ; set before this loop was entered.
\r
612 ; All comparisons passed, start a new itteratio of this loop.
\r
616 ; A compare failed, just loop here so the loop counter stops incrementing
\r
617 ; causing the check task to indicate the error.
\r
620 /*-----------------------------------------------------------*/
\r
622 /* This function is explained in the comments at the top of this file. */
\r
623 #pragma inline_asm prvRegTest2Implementation
\r
624 static void prvRegTest2Implementation( void )
\r
626 ; Put a known value in each register.
\r
643 ; Loop, checking on each itteration that each register still contains the
\r
647 ; Push the registers that are going to get clobbered.
\r
650 ; Increment the loop counter to show this task is still getting CPU time.
\r
651 MOV.L #_ulRegTest2CycleCount, R14
\r
656 ; Restore the clobbered registers.
\r
690 ; All comparisons passed, start a new itteratio of this loop.
\r
694 ; A compare failed, just loop here so the loop counter stops incrementing
\r
695 ; - causing the check task to indicate the error.
\r
698 /*-----------------------------------------------------------*/
\r
700 char *pcGetTaskStatusMessage( void )
\r
702 /* Not bothered about a critical section here although technically because of
\r
703 the task priorities the pointer could change it will be atomic if not near
\r
704 atomic and its not critical. */
\r
705 return ( char * ) pcStatusMessage;
\r
707 /*-----------------------------------------------------------*/
\r