]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_RZ_R7S72100_IAR_DS-5/Source/Full-Demo/main_full.c
3c893cebf9761007b54d2d75056925ed83e854fe
[freertos] / FreeRTOS / Demo / CORTEX_A9_RZ_R7S72100_IAR_DS-5 / Source / Full-Demo / main_full.c
1 /*\r
2     FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
3 \r
4     FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
5     http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
10      *    Complete, revised, and edited pdf reference manuals are also       *\r
11      *    available.                                                         *\r
12      *                                                                       *\r
13      *    Purchasing FreeRTOS documentation will not only help you, by       *\r
14      *    ensuring you get running as quickly as possible and with an        *\r
15      *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
16      *    the FreeRTOS project to continue with its mission of providing     *\r
17      *    professional grade, cross platform, de facto standard solutions    *\r
18      *    for microcontrollers - completely free of charge!                  *\r
19      *                                                                       *\r
20      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
21      *                                                                       *\r
22      *    Thank you for using FreeRTOS, and thank you for your support!      *\r
23      *                                                                       *\r
24     ***************************************************************************\r
25 \r
26 \r
27     This file is part of the FreeRTOS distribution.\r
28 \r
29     FreeRTOS is free software; you can redistribute it and/or modify it under\r
30     the terms of the GNU General Public License (version 2) as published by the\r
31     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
32 \r
33     >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
34     distribute a combined work that includes FreeRTOS without being obliged to\r
35     provide the source code for proprietary components outside of the FreeRTOS\r
36     kernel.\r
37 \r
38     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
39     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
40     FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
41     details. You should have received a copy of the GNU General Public License\r
42     and the FreeRTOS license exception along with FreeRTOS; if not it can be\r
43     viewed here: http://www.freertos.org/a00114.html and also obtained by\r
44     writing to Real Time Engineers Ltd., contact details for whom are available\r
45     on the FreeRTOS WEB site.\r
46 \r
47     1 tab == 4 spaces!\r
48 \r
49     ***************************************************************************\r
50      *                                                                       *\r
51      *    Having a problem?  Start by reading the FAQ "My application does   *\r
52      *    not run, what could be wrong?"                                     *\r
53      *                                                                       *\r
54      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
55      *                                                                       *\r
56     ***************************************************************************\r
57 \r
58 \r
59     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
60     license and Real Time Engineers Ltd. contact details.\r
61 \r
62     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
63     including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
64     fully thread aware and reentrant UDP/IP stack.\r
65 \r
66     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
67     Integrity Systems, who sell the code with commercial support,\r
68     indemnification and middleware, under the OpenRTOS brand.\r
69 \r
70     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
71     engineered and independently SIL3 certified version for use in safety and\r
72     mission critical applications that require provable dependability.\r
73 */\r
74 \r
75 /******************************************************************************\r
76  * NOTE 1:  This project provides two demo applications.  A simple blinky style\r
77  * project, and a more comprehensive test and demo application.  The\r
78  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
79  * between the two.  See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
80  * in main.c.  This file implements the comprehensive test and demo version.\r
81  *\r
82  * NOTE 2:  This file only contains the source code that is specific to the\r
83  * full demo.  Generic functions, such FreeRTOS hook functions, and functions\r
84  * required to configure the hardware, are defined in main.c.\r
85  *\r
86  * NOTE 3:  If mainINCLUDE_FAT_SL_DEMO is set to 1 then the UART is used to\r
87  * interface to the FreeRTOS+CLI command line interface.  If\r
88  * mainINCLUDE_FAT_SL_DEMO is set to 0 then the UART is used to run the standard\r
89  * COM test tasks and a loopback connector must be fitted to the UART port\r
90  * because the test expects to receive every character that is transmitted.  A\r
91  * simple loopback connector can be created by linking pins 2 and 3 of the 9 way\r
92  * UART connector.\r
93  ******************************************************************************\r
94  *\r
95  * main_full() creates all the demo application tasks and software timers, then\r
96  * starts the scheduler.  The web documentation provides more details of the\r
97  * standard demo application tasks, which provide no particular functionality,\r
98  * but do provide a good example of how to use the FreeRTOS API.\r
99  *\r
100  * In addition to the standard demo tasks, the following tasks and tests are\r
101  * defined and/or created within this file:\r
102  *\r
103  * FreeRTOS+CLI command console.  The command console is access through UART2\r
104  * using 115200 baud if mainINCLUDE_FAT_SL_DEMO is set to 1.  For reasons of\r
105  * robustness testing the UART driver is deliberately written to be inefficient\r
106  * and should not be used as a template for a production driver.  Type "help" to\r
107  * see a list of registered commands.  The FreeRTOS+CLI license is different to\r
108  * the FreeRTOS license, see http://www.FreeRTOS.org/cli for license and usage\r
109  * details.\r
110  *\r
111  * FreeRTOS+FAT SL.  FreeRTOS+FAT SL is demonstrated using a RAM disk if\r
112  * mainINCLUDE_FAT_SL_DEMO is set to 1.  [At the time of writing] The\r
113  * functionality of the file system demo is identical to the functionality of\r
114  * the FreeRTOS Win32 simulator file system demo, with the command console being\r
115  * accessed via the UART (as described above) instead of a network terminal.\r
116  * The FreeRTOS+FAT SL license is different to the FreeRTOS license, see\r
117  * http://www.FreeRTOS.org/fat_sl for license and usage details, and a\r
118  * description of the file system demo functionality.\r
119  *\r
120  * "Reg test" tasks - These fill both the core and floating point registers with\r
121  * known values, then check that each register maintains its expected value for\r
122  * the lifetime of the task.  Each task uses a different set of values.  The reg\r
123  * test tasks execute with a very low priority, so get preempted very\r
124  * frequently.  A register containing an unexpected value is indicative of an\r
125  * error in the context switching mechanism.\r
126  *\r
127  * "Check" task - The check task period is initially set to three seconds.  The\r
128  * task checks that all the standard demo tasks, and the register check tasks,\r
129  * are not only still executing, but are executing without reporting any errors.\r
130  * If the check task discovers that a task has either stalled, or reported an\r
131  * error, then it changes its own execution period from the initial three\r
132  * seconds, to just 200ms.  The check task also toggles an LED each time it is\r
133  * called.  This provides a visual indication of the system status:  If the LED\r
134  * toggles every three seconds, then no issues have been discovered.  If the LED\r
135  * toggles every 200ms, then an issue has been discovered with at least one\r
136  * task.\r
137  */\r
138 \r
139 /* Standard includes. */\r
140 #include <stdio.h>\r
141 \r
142 /* Kernel includes. */\r
143 #include "FreeRTOS.h"\r
144 #include "task.h"\r
145 #include "timers.h"\r
146 #include "semphr.h"\r
147 \r
148 /* Standard demo application includes. */\r
149 #include "flop.h"\r
150 #include "semtest.h"\r
151 #include "dynamic.h"\r
152 #include "BlockQ.h"\r
153 #include "blocktim.h"\r
154 #include "countsem.h"\r
155 #include "GenQTest.h"\r
156 #include "recmutex.h"\r
157 #include "death.h"\r
158 #include "partest.h"\r
159 #include "comtest2.h"\r
160 #include "serial.h"\r
161 #include "TimerDemo.h"\r
162 \r
163 /* FreeRTOS+CLI and FreeRTOS+FAT SL includes. */\r
164 #include "UARTCommandConsole.h"\r
165 \r
166 /* Either the FreeRTOS+FAT SL demo or the COM test demo can be build into the\r
167 project, not both (because they use the same UART).  Set\r
168 configINCLUDE_FAT_SL_DEMO to 1 to include the FreeRTOS+FAT SL (and therefore\r
169 also FreeRTOS+CLI) demo in the build.  Set configINCLUDE_FAT_SL_DEMO to 0 to\r
170 include the COM test tasks.  The COM test tasks require a loop back connector\r
171 to be fitted to the UART port. */\r
172 #define mainINCLUDE_FAT_SL_DEMO                         0\r
173 \r
174 /* Priorities for the demo application tasks. */\r
175 #define mainSEM_TEST_PRIORITY                           ( tskIDLE_PRIORITY + 1UL )\r
176 #define mainBLOCK_Q_PRIORITY                            ( tskIDLE_PRIORITY + 2UL )\r
177 #define mainCREATOR_TASK_PRIORITY                       ( tskIDLE_PRIORITY + 3UL )\r
178 #define mainFLOP_TASK_PRIORITY                          ( tskIDLE_PRIORITY )\r
179 #define mainUART_COMMAND_CONSOLE_STACK_SIZE     ( configMINIMAL_STACK_SIZE * 3UL )\r
180 #define mainCOM_TEST_TASK_PRIORITY                      ( tskIDLE_PRIORITY + 2 )\r
181 #define mainCHECK_TASK_PRIORITY                         ( configMAX_PRIORITIES - 1 )\r
182 \r
183 /* The priority used by the UART command console task. */\r
184 #define mainUART_COMMAND_CONSOLE_TASK_PRIORITY  ( configMAX_PRIORITIES - 2 )\r
185 \r
186 /* The LED used by the check timer. */\r
187 #define mainCHECK_LED                                           ( 0 )\r
188 \r
189 /* A block time of zero simply means "don't block". */\r
190 #define mainDONT_BLOCK                                          ( 0UL )\r
191 \r
192 /* In this example the baud rate is hard coded and there is no LED for use by\r
193 the COM test tasks, so just set both to invalid values. */\r
194 #define mainCOM_TEST_LED                                        ( 100 )\r
195 #define mainBAUD_RATE                                           ( 0 )\r
196 \r
197 /* The period after which the check timer will expire, in ms, provided no errors\r
198 have been reported by any of the standard demo tasks.  ms are converted to the\r
199 equivalent in ticks using the portTICK_RATE_MS constant. */\r
200 #define mainNO_ERROR_CHECK_TASK_PERIOD                  ( 3000UL / portTICK_RATE_MS )\r
201 \r
202 /* The period at which the check timer will expire, in ms, if an error has been\r
203 reported in one of the standard demo tasks.  ms are converted to the equivalent\r
204 in ticks using the portTICK_RATE_MS constant. */\r
205 #define mainERROR_CHECK_TASK_PERIOD     ( 200UL / portTICK_RATE_MS )\r
206 \r
207 /* Parameters that are passed into the register check tasks solely for the\r
208 purpose of ensuring parameters are passed into tasks correctly. */\r
209 #define mainREG_TEST_TASK_1_PARAMETER           ( ( void * ) 0x12345678 )\r
210 #define mainREG_TEST_TASK_2_PARAMETER           ( ( void * ) 0x87654321 )\r
211 \r
212 /* The base period used by the timer test tasks. */\r
213 #define mainTIMER_TEST_PERIOD                           ( 50 )\r
214 \r
215 /* The length of queues used to pass characters into and out of the UART\r
216 interrupt.  Note the comments above about the UART driver being implemented in\r
217 this way to test the kernel robustness rather than to provide a template for an\r
218 efficient production driver. */\r
219 #define mainUART_QUEUE_LENGTHS  10\r
220 \r
221 /*-----------------------------------------------------------*/\r
222 \r
223 /*\r
224  * Called by main() to run the full demo (as opposed to the blinky demo) when\r
225  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.\r
226  */\r
227 void main_full( void );\r
228 \r
229 /*\r
230  * The check task, as described at the top of this file.\r
231  */\r
232 static void prvCheckTask( void *pvParameters );\r
233 \r
234 /*\r
235  * Register check tasks, and the tasks used to write over and check the contents\r
236  * of the FPU registers, as described at the top of this file.  The nature of\r
237  * these files necessitates that they are written in an assembly file, but the\r
238  * entry points are kept in the C file for the convenience of checking the task\r
239  * parameter.\r
240  */\r
241 static void prvRegTestTaskEntry1( void *pvParameters );\r
242 extern void vRegTest1Implementation( void );\r
243 static void prvRegTestTaskEntry2( void *pvParameters );\r
244 extern void vRegTest2Implementation( void );\r
245 \r
246 /*\r
247  * Register commands that can be used with FreeRTOS+CLI.  The commands are\r
248  * defined in CLI-Commands.c and File-Related-CLI-Command.c respectively.\r
249  */\r
250 extern void vRegisterSampleCLICommands( void );\r
251 extern void vRegisterFileSystemCLICommands( void );\r
252 \r
253 /*\r
254  * Creates and verifies different files on the volume, demonstrating the use of\r
255  * various different API functions.\r
256  */\r
257 extern void vCreateAndVerifySampleFiles( void );\r
258 \r
259 /*-----------------------------------------------------------*/\r
260 \r
261 /* The following two variables are used to communicate the status of the\r
262 register check tasks to the check software timer.  If the variables keep\r
263 incrementing, then the register check tasks has not discovered any errors.  If\r
264 a variable stops incrementing, then an error has been found. */\r
265 volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;\r
266 \r
267 /*-----------------------------------------------------------*/\r
268 \r
269 void main_full( void )\r
270 {\r
271         /* The baud rate setting here has no effect, hence it is set to 0 to\r
272         make that obvious. */\r
273         xSerialPortInitMinimal( 0, mainUART_QUEUE_LENGTHS );\r
274 \r
275         /* If the file system is only going to be accessed from one task then\r
276         F_FS_THREAD_AWARE can be set to 0 and the set of example files are created\r
277         before the RTOS scheduler is started.  If the file system is going to be\r
278         access from more than one task then F_FS_THREAD_AWARE must be set to 1 and\r
279         the     set of sample files are created from the idle task hook function\r
280         vApplicationIdleHook() - which is defined in this file. */\r
281         #if ( mainINCLUDE_FAT_SL_DEMO == 1 )&& ( F_FS_THREAD_AWARE == 0 )\r
282         {\r
283                 /* Initialise the drive and file system, then create a few example\r
284                 files.  The output from this function just goes to the stdout window,\r
285                 allowing the output to be viewed when the UDP command console is not\r
286                 connected. */\r
287                 vCreateAndVerifySampleFiles();\r
288         }\r
289         #endif\r
290 \r
291         /* Start all the other standard demo/test tasks.  The have not particular\r
292         functionality, but do demonstrate how to use the FreeRTOS API and test the\r
293         kernel port. */\r
294         vStartDynamicPriorityTasks();\r
295         vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
296         vCreateBlockTimeTasks();\r
297         vStartCountingSemaphoreTasks();\r
298         vStartGenericQueueTasks( tskIDLE_PRIORITY );\r
299         vStartRecursiveMutexTasks();\r
300         vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
301         vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
302         vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
303 \r
304         #if mainINCLUDE_FAT_SL_DEMO == 1\r
305         {\r
306                 /* Start the tasks that implements the command console on the UART, as\r
307                 described above. */\r
308                 vUARTCommandConsoleStart( mainUART_COMMAND_CONSOLE_STACK_SIZE, mainUART_COMMAND_CONSOLE_TASK_PRIORITY );\r
309 \r
310                 /* Register both the standard and file system related CLI commands. */\r
311                 vRegisterSampleCLICommands();\r
312                 vRegisterFileSystemCLICommands();\r
313         }\r
314         #else\r
315         {\r
316                 /* The COM test tasks can use the UART if the CLI is not used by the\r
317                 FAT SL demo.  The COM test tasks require a UART connector to be fitted\r
318                 to the UART port. */\r
319                 vAltStartComTestTasks( mainCOM_TEST_TASK_PRIORITY, mainBAUD_RATE, mainCOM_TEST_LED );\r
320         }\r
321         #endif\r
322 \r
323 \r
324         /* Create the register check tasks, as described at the top of this\r
325         file */\r
326         xTaskCreate( prvRegTestTaskEntry1, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
327         xTaskCreate( prvRegTestTaskEntry2, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
328 \r
329         /* Create the task that performs the 'check' functionality,     as described at\r
330         the top of this file. */\r
331         xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
332 \r
333         /* The set of tasks created by the following function call have to be\r
334         created last as they keep account of the number of tasks they expect to see\r
335         running. */\r
336         vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
337 \r
338         /* Start the scheduler. */\r
339         vTaskStartScheduler();\r
340 \r
341         /* If all is well, the scheduler will now be running, and the following\r
342         line will never be reached.  If the following line does execute, then\r
343         there was either insufficient FreeRTOS heap memory available for the idle\r
344         and/or timer tasks to be created, or vTaskStartScheduler() was called from\r
345         User mode.  See the memory management section on the FreeRTOS web site for\r
346         more details on the FreeRTOS heap http://www.freertos.org/a00111.html.  The\r
347         mode from which main() is called is set in the C start up code and must be\r
348         a privileged mode (not user mode). */\r
349         for( ;; );\r
350 }\r
351 /*-----------------------------------------------------------*/\r
352 \r
353 static void prvCheckTask( void *pvParameters )\r
354 {\r
355 portTickType xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;\r
356 portTickType xLastExecutionTime;\r
357 static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;\r
358 unsigned long ulErrorFound = pdFALSE;\r
359 \r
360         /* Just to stop compiler warnings. */\r
361         ( void ) pvParameters;\r
362 \r
363         /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()\r
364         works correctly. */\r
365         xLastExecutionTime = xTaskGetTickCount();\r
366 \r
367         /* Cycle for ever, delaying then checking all the other tasks are still\r
368         operating without error.  The onboard LED is toggled on each iteration.\r
369         If an error is detected then the delay period is decreased from\r
370         mainNO_ERROR_CHECK_TASK_PERIOD to mainERROR_CHECK_TASK_PERIOD.  This has the\r
371         effect of increasing the rate at which the onboard LED toggles, and in so\r
372         doing gives visual feedback of the system status. */\r
373         for( ;; )\r
374         {\r
375                 /* Delay until it is time to execute again. */\r
376                 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );\r
377 \r
378                 /* Check all the demo tasks (other than the flash tasks) to ensure\r
379                 that they are all still running, and that none have detected an error. */\r
380                 if( xAreMathsTaskStillRunning() != pdTRUE )\r
381                 {\r
382                         ulErrorFound = pdTRUE;\r
383                 }\r
384 \r
385                 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
386                 {\r
387                         ulErrorFound = pdTRUE;\r
388                 }\r
389 \r
390                 if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
391                 {\r
392                         ulErrorFound = pdTRUE;\r
393                 }\r
394 \r
395                 if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
396                 {\r
397                         ulErrorFound = pdTRUE;\r
398                 }\r
399 \r
400                 if ( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
401                 {\r
402                         ulErrorFound = pdTRUE;\r
403                 }\r
404 \r
405                 if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
406                 {\r
407                         ulErrorFound = pdTRUE;\r
408                 }\r
409 \r
410                 if( xIsCreateTaskStillRunning() != pdTRUE )\r
411                 {\r
412                         ulErrorFound = pdTRUE;\r
413                 }\r
414 \r
415                 if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
416                 {\r
417                         ulErrorFound = pdTRUE;\r
418                 }\r
419 \r
420                 if( xAreTimerDemoTasksStillRunning( ( portTickType ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )\r
421                 {\r
422                         ulErrorFound = pdTRUE;\r
423                 }\r
424 \r
425                 if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
426                 {\r
427                         ulErrorFound = pdTRUE;\r
428                 }\r
429 \r
430                 #if mainINCLUDE_FAT_SL_DEMO == 0\r
431                 {\r
432                         if( xAreComTestTasksStillRunning() != pdTRUE )\r
433                         {\r
434                                 ulErrorFound = pdTRUE;\r
435                         }\r
436                 }\r
437                 #endif\r
438 \r
439                 /* Check that the register test 1 task is still running. */\r
440                 if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
441                 {\r
442                         ulErrorFound = pdTRUE;\r
443                 }\r
444                 ulLastRegTest1Value = ulRegTest1LoopCounter;\r
445 \r
446                 /* Check that the register test 2 task is still running. */\r
447                 if( ulLastRegTest2Value == ulRegTest2LoopCounter )\r
448                 {\r
449                         ulErrorFound = pdTRUE;\r
450                 }\r
451                 ulLastRegTest2Value = ulRegTest2LoopCounter;\r
452 \r
453                 /* Toggle the check LED to give an indication of the system status.  If\r
454                 the LED toggles every mainNO_ERROR_CHECK_TASK_PERIOD milliseconds then\r
455                 everything is ok.  A faster toggle indicates an error. */\r
456                 vParTestToggleLED( mainCHECK_LED );\r
457 \r
458                 if( ulErrorFound != pdFALSE )\r
459                 {\r
460                         /* An error has been detected in one of the tasks - flash the LED\r
461                         at a higher frequency to give visible feedback that something has\r
462                         gone wrong (it might just be that the loop back connector required\r
463                         by the comtest tasks has not been fitted). */\r
464                         xDelayPeriod = mainERROR_CHECK_TASK_PERIOD;\r
465                 }\r
466         }\r
467 }\r
468 /*-----------------------------------------------------------*/\r
469 \r
470 static void prvRegTestTaskEntry1( void *pvParameters )\r
471 {\r
472         /* Although the regtest task is written in assembler, its entry point is\r
473         written in C for convenience of checking the task parameter is being passed\r
474         in correctly. */\r
475         if( pvParameters == mainREG_TEST_TASK_1_PARAMETER )\r
476         {\r
477                 /* The reg test task also tests the floating point registers.  Tasks\r
478                 that use the floating point unit must call vPortTaskUsesFPU() before\r
479                 any floating point instructions are executed. */\r
480                 vPortTaskUsesFPU();\r
481 \r
482                 /* Start the part of the test that is written in assembler. */\r
483                 vRegTest1Implementation();\r
484         }\r
485 \r
486         /* The following line will only execute if the task parameter is found to\r
487         be incorrect.  The check timer will detect that the regtest loop counter is\r
488         not being incremented and flag an error. */\r
489         vTaskDelete( NULL );\r
490 }\r
491 /*-----------------------------------------------------------*/\r
492 \r
493 static void prvRegTestTaskEntry2( void *pvParameters )\r
494 {\r
495         /* Although the regtest task is written in assembler, its entry point is\r
496         written in C for convenience of checking the task parameter is being passed\r
497         in correctly. */\r
498         if( pvParameters == mainREG_TEST_TASK_2_PARAMETER )\r
499         {\r
500                 /* The reg test task also tests the floating point registers.  Tasks\r
501                 that use the floating point unit must call vPortTaskUsesFPU() before\r
502                 any floating point instructions are executed. */\r
503                 vPortTaskUsesFPU();\r
504 \r
505                 /* Start the part of the test that is written in assembler. */\r
506                 vRegTest2Implementation();\r
507         }\r
508 \r
509         /* The following line will only execute if the task parameter is found to\r
510         be incorrect.  The check timer will detect that the regtest loop counter is\r
511         not being incremented and flag an error. */\r
512         vTaskDelete( NULL );\r
513 }\r
514 /*-----------------------------------------------------------*/\r
515 \r
516 \r
517 \r
518 \r