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