]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX100-RSK_Renesas_e2studio/RTOSDemo/main_full.c
Update version numbers in preparation for V8.2.0 release candidate 1.
[freertos] / FreeRTOS / Demo / RX100-RSK_Renesas_e2studio / RTOSDemo / main_full.c
1 /*\r
2     FreeRTOS V8.2.0rc1 - Copyright (C) 2014 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     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
14     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
15     >>!   obliged to provide the source code for proprietary components     !<<\r
16     >>!   outside of the FreeRTOS kernel.                                   !<<\r
17 \r
18     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
19     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
20     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
21     link: http://www.freertos.org/a00114.html\r
22 \r
23     1 tab == 4 spaces!\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    Having a problem?  Start by reading the FAQ "My application does   *\r
28      *    not run, what could be wrong?".  Have you defined configASSERT()?  *\r
29      *                                                                       *\r
30      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
31      *                                                                       *\r
32     ***************************************************************************\r
33 \r
34     ***************************************************************************\r
35      *                                                                       *\r
36      *    FreeRTOS provides completely free yet professionally developed,    *\r
37      *    robust, strictly quality controlled, supported, and cross          *\r
38      *    platform software that is more than just the market leader, it     *\r
39      *    is the industry's de facto standard.                               *\r
40      *                                                                       *\r
41      *    Help yourself get started quickly while simultaneously helping     *\r
42      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
43      *    tutorial book, reference manual, or both:                          *\r
44      *    http://www.FreeRTOS.org/Documentation                              *\r
45      *                                                                       *\r
46     ***************************************************************************\r
47 \r
48     ***************************************************************************\r
49      *                                                                       *\r
50      *   Investing in training allows your team to be as productive as       *\r
51      *   possible as early as possible, lowering your overall development    *\r
52      *   cost, and enabling you to bring a more robust product to market     *\r
53      *   earlier than would otherwise be possible.  Richard Barry is both    *\r
54      *   the architect and key author of FreeRTOS, and so also the world's   *\r
55      *   leading authority on what is the world's most popular real time     *\r
56      *   kernel for deeply embedded MCU designs.  Obtaining your training    *\r
57      *   from Richard ensures your team will gain directly from his in-depth *\r
58      *   product knowledge and years of usage experience.  Contact Real Time *\r
59      *   Engineers Ltd to enquire about the FreeRTOS Masterclass, presented  *\r
60      *   by Richard Barry:  http://www.FreeRTOS.org/contact\r
61      *                                                                       *\r
62     ***************************************************************************\r
63 \r
64     ***************************************************************************\r
65      *                                                                       *\r
66      *    You are receiving this top quality software for free.  Please play *\r
67      *    fair and reciprocate by reporting any suspected issues and         *\r
68      *    participating in the community forum:                              *\r
69      *    http://www.FreeRTOS.org/support                                    *\r
70      *                                                                       *\r
71      *    Thank you!                                                         *\r
72      *                                                                       *\r
73     ***************************************************************************\r
74 \r
75     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
76     license and Real Time Engineers Ltd. contact details.\r
77 \r
78     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
79     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
80     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
81 \r
82     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
83     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
84 \r
85     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
86     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
87     licenses offer ticketed support, indemnification and commercial middleware.\r
88 \r
89     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
90     engineered and independently SIL3 certified version for use in safety and\r
91     mission critical applications that require provable dependability.\r
92 \r
93     1 tab == 4 spaces!\r
94 */\r
95 \r
96 /* ****************************************************************************\r
97  * This project includes a lot of tasks and tests and is therefore complex.\r
98  * If you would prefer a much simpler project to get started with then select\r
99  * the 'low power' demo by setting configCREATE_LOW_POWER_DEMO to 1 in\r
100  * FreeRTOSConfig.h.  When configCREATE_LOW_POWER_DEMO is set to 1 main() will\r
101  * call main_low_power() instead of main_full().\r
102  * ****************************************************************************\r
103  *\r
104  * Creates all the demo application tasks, then starts the scheduler.  The web\r
105  * documentation provides more details of the standard demo application tasks,\r
106  * which provide no particular functionality but do provide a good example of\r
107  * how to use the FreeRTOS API.\r
108  *\r
109  * In addition to the standard demo tasks, the following tasks and tests are\r
110  * defined and/or created within this file:\r
111  *\r
112  * "Reg test" tasks - These fill the registers with known values, then\r
113  * repeatedly check that each register still contains its expected value for\r
114  * the lifetime of the tasks.  Each task uses different values.  The tasks run\r
115  * with very low priority so get preempted very frequently.  A check variable\r
116  * is incremented on each iteration of the test loop.  A register containing an\r
117  * unexpected value is indicative of an error in the context switching\r
118  * mechanism and will result in a branch to a null loop - which in turn will\r
119  * prevent the check variable from incrementing any further and allow the check\r
120  * timer (described below) to determine that an error has occurred.  The nature\r
121  * of the reg test tasks necessitates that they are written in assembly code.\r
122  *\r
123  * "Check Timer" and Callback Function - The check timer period is initially\r
124  * set to three seconds.  The check timer callback function checks that all the\r
125  * standard demo tasks are not only still executing, but are executing without\r
126  * reporting any errors.  If the check timer discovers that a task has either\r
127  * stalled, or reported an error, then it changes its own period from the\r
128  * initial three seconds, to just 200ms.  The check timer callback function\r
129  * also toggles LED 0 each time it is called.  This provides a visual\r
130  * indication of the system status:  If the LED toggles every three seconds,\r
131  * then no issues have been discovered.  If the LED toggles every 200ms, then\r
132  * an issue has been discovered with at least one task.\r
133  *\r
134  * *NOTE 1* The CPU must be in Supervisor mode when the scheduler is started.\r
135  * The PowerON_Reset_PC() supplied in resetprg.c with this demo has\r
136  * Change_PSW_PM_to_UserMode() commented out to ensure this is the case.\r
137 */\r
138 \r
139 /* Standard includes. */\r
140 #include <string.h>\r
141 \r
142 /* Hardware specific includes. */\r
143 #include "iodefine.h"\r
144 \r
145 /* Kernel includes. */\r
146 #include "FreeRTOS.h"\r
147 #include "task.h"\r
148 #include "timers.h"\r
149 #include "semphr.h"\r
150 \r
151 /* Standard demo includes. */\r
152 #include "partest.h"\r
153 #include "death.h"\r
154 #include "blocktim.h"\r
155 #include "GenQTest.h"\r
156 #include "recmutex.h"\r
157 \r
158 /* The code in this file is only built when configCREATE_LOW_POWER_DEMO is set\r
159 to 0, otherwise the code in main_low_power.c is used. */\r
160 #if configCREATE_LOW_POWER_DEMO == 0\r
161 \r
162 \r
163 /* Values that are passed into the reg test tasks using the task parameter.\r
164 The tasks check that the values are passed in correctly. */\r
165 #define mainREG_TEST_1_PARAMETER        ( 0x12121212UL )\r
166 #define mainREG_TEST_2_PARAMETER        ( 0x12345678UL )\r
167 \r
168 /* Priorities at which the standard demo tasks are created. */\r
169 #define mainGEN_QUEUE_TASK_PRIORITY     ( tskIDLE_PRIORITY )\r
170 #define mainCREATOR_TASK_PRIORITY   ( tskIDLE_PRIORITY + 3 )\r
171 \r
172 /* The LED toggled by the check timer. */\r
173 #define mainCHECK_LED                           ( 0 )\r
174 \r
175 /* The period at which the check timer will expire, in ms, provided no errors\r
176 have been reported by any of the standard demo tasks.  ms are converted to the\r
177 equivalent in ticks using the portTICK_PERIOD_MS constant. */\r
178 #define mainCHECK_TIMER_PERIOD_MS                       ( 3000UL / portTICK_PERIOD_MS )\r
179 \r
180 /* The period at which the check timer will expire, in ms, if an error has been\r
181 reported in one of the standard demo tasks.  ms are converted to the equivalent\r
182 in ticks using the portTICK_PERIOD_MS constant. */\r
183 #define mainERROR_CHECK_TIMER_PERIOD_MS         ( 200UL / portTICK_PERIOD_MS )\r
184 \r
185 /* A block time of zero simple means "Don't Block". */\r
186 #define mainDONT_BLOCK                          ( 0UL )\r
187 \r
188 /*\r
189  * The reg test tasks as described at the top of this file.\r
190  */\r
191 static void prvRegTest1Task( void *pvParameters );\r
192 static void prvRegTest2Task( void *pvParameters );\r
193 \r
194 /*\r
195  * The actual implementation of the reg test functionality, which, because of\r
196  * the direct register access, have to be in assembly.\r
197  */\r
198 static void prvRegTest1Implementation( void );\r
199 static void prvRegTest2Implementation( void );\r
200 \r
201 /*\r
202  * The check timer callback function, as described at the top of this file.\r
203  */\r
204 static void prvCheckTimerCallback( TimerHandle_t xTimer );\r
205 \r
206 \r
207 /*-----------------------------------------------------------*/\r
208 \r
209 /* Variables that are incremented on each iteration of the reg test tasks -\r
210 provided the tasks have not reported any errors.  The check timer inspects these\r
211 variables to ensure they are still incrementing as expected.  If a variable\r
212 stops incrementing then it is likely that its associated task has stalled. */\r
213 unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;\r
214 \r
215 /* The check timer.  This uses prvCheckTimerCallback() as its callback\r
216 function. */\r
217 static TimerHandle_t xCheckTimer = NULL;\r
218 \r
219 /*-----------------------------------------------------------*/\r
220 \r
221 void main_full( void )\r
222 {\r
223         /* Start the reg test tasks which test the context switching mechanism. */\r
224         xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
225         xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
226 \r
227         /* Create the standard demo tasks. */\r
228         vCreateBlockTimeTasks();\r
229         vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
230         vStartRecursiveMutexTasks();\r
231 \r
232         /* The suicide tasks must be created last as they need to know how many\r
233         tasks were running prior to their creation in order to ascertain whether\r
234         or not the correct/expected number of tasks are running at any given time. */\r
235         vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
236 \r
237         /* Create the software timer that performs the 'check' functionality,\r
238         as described at the top of this file. */\r
239         xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
240                                                                 ( mainCHECK_TIMER_PERIOD_MS ),          /* The timer period, in this case 5000ms (5s). */\r
241                                                                 pdTRUE,                                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
242                                                                 ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
243                                                                 prvCheckTimerCallback                           /* The callback function that inspects the status of all the other tasks. */\r
244                                                           );\r
245 \r
246         configASSERT( xCheckTimer );\r
247 \r
248         /* Start the check timer.  It will actually start when the scheduler is\r
249         started. */\r
250         xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
251 \r
252         /* Start the tasks running. */\r
253         vTaskStartScheduler();\r
254 \r
255         /* If all is well execution will never reach here as the scheduler will be\r
256         running.  If this null loop is reached then it is likely there was\r
257         insufficient FreeRTOS heap available for the idle task and/or timer task to\r
258         be created.  See http://www.freertos.org/a00111.html. */\r
259         for( ;; );\r
260 }\r
261 /*-----------------------------------------------------------*/\r
262 \r
263 static void prvCheckTimerCallback( TimerHandle_t xTimer )\r
264 {\r
265 static long lChangedTimerPeriodAlready = pdFALSE, lErrorStatus = pdPASS;\r
266 static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;\r
267 \r
268         /* Remove compiler warnings about unused parameters. */\r
269         ( void ) xTimer;\r
270 \r
271         /* Check the standard demo tasks are running without error. */\r
272         if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
273         {\r
274                 lErrorStatus = pdFAIL;\r
275         }\r
276         else if( xIsCreateTaskStillRunning() != pdTRUE )\r
277         {\r
278                 lErrorStatus = pdFAIL;\r
279         }\r
280         else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
281         {\r
282                 lErrorStatus = pdFAIL;\r
283         }\r
284         else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
285         {\r
286                 lErrorStatus = pdFAIL;\r
287         }\r
288 \r
289         /* Check the reg test tasks are still cycling.  They will stop incrementing\r
290         their loop counters if they encounter an error. */\r
291         if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )\r
292         {\r
293                 lErrorStatus = pdFAIL;\r
294         }\r
295 \r
296         if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )\r
297         {\r
298                 lErrorStatus = pdFAIL;\r
299         }\r
300 \r
301         /* Remember the loop counter values this time around so they can be checked\r
302         again the next time this callback function executes. */\r
303         ulLastRegTest1CycleCount = ulRegTest1CycleCount;\r
304         ulLastRegTest2CycleCount = ulRegTest2CycleCount;\r
305 \r
306         /* Toggle the check LED to give an indication of the system status.  If\r
307         the LED toggles every three seconds then everything is ok.  A faster toggle\r
308         indicates an error. */\r
309         vParTestToggleLED( mainCHECK_LED );\r
310 \r
311         /* Was an error detected this time through the callback execution? */\r
312         if( lErrorStatus != pdPASS )\r
313         {\r
314                 if( lChangedTimerPeriodAlready == pdFALSE )\r
315                 {\r
316                         lChangedTimerPeriodAlready = pdTRUE;\r
317 \r
318                         /* This call to xTimerChangePeriod() uses a zero block time.\r
319                         Functions called from inside of a timer callback function must\r
320                         *never* attempt to block. */\r
321                         xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
322                 }\r
323         }\r
324 }\r
325 /*-----------------------------------------------------------*/\r
326 \r
327 /* This function is explained in the comments at the top of this file. */\r
328 static void prvRegTest1Task( void *pvParameters )\r
329 {\r
330         if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_1_PARAMETER )\r
331         {\r
332                 /* The parameter did not contain the expected value. */\r
333                 for( ;; )\r
334                 {\r
335                         /* Stop the tick interrupt so its obvious something has gone wrong. */\r
336                         taskDISABLE_INTERRUPTS();\r
337                 }\r
338         }\r
339 \r
340         /* This is an inline asm function that never returns. */\r
341         prvRegTest1Implementation();\r
342 }\r
343 /*-----------------------------------------------------------*/\r
344 \r
345 /* This function is explained in the comments at the top of this file. */\r
346 static void prvRegTest2Task( void *pvParameters )\r
347 {\r
348         if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_2_PARAMETER )\r
349         {\r
350                 /* The parameter did not contain the expected value. */\r
351                 for( ;; )\r
352                 {\r
353                         /* Stop the tick interrupt so its obvious something has gone wrong. */\r
354                         taskDISABLE_INTERRUPTS();\r
355                 }\r
356         }\r
357 \r
358         /* This is an inline asm function that never returns. */\r
359         prvRegTest2Implementation();\r
360 }\r
361 /*-----------------------------------------------------------*/\r
362 \r
363 /* This function is explained in the comments at the top of this file. */\r
364 #pragma inline_asm prvRegTest1Implementation\r
365 static void prvRegTest1Implementation( void )\r
366 {\r
367         ; Put a known value in each register.\r
368         MOV.L   #11111111H, R15\r
369         MVTACHI R15\r
370         MOV.L   #22222222H, R15\r
371         MVTACLO R15\r
372         MOV.L   #1, R1\r
373         MOV.L   #2, R2\r
374         MOV.L   #3, R3\r
375         MOV.L   #4, R4\r
376         MOV.L   #5, R5\r
377         MOV.L   #6, R6\r
378         MOV.L   #7, R7\r
379         MOV.L   #8, R8\r
380         MOV.L   #9, R9\r
381         MOV.L   #10, R10\r
382         MOV.L   #11, R11\r
383         MOV.L   #12, R12\r
384         MOV.L   #13, R13\r
385         MOV.L   #14, R14\r
386         MOV.L   #15, R15\r
387 \r
388         ; Loop, checking each iteration that each register still contains the\r
389         ; expected value.\r
390 TestLoop1:\r
391 \r
392         ; Push the registers that are going to get clobbered.\r
393         PUSHM   R14-R15\r
394 \r
395         ; Increment the loop counter to show this task is still getting CPU time.\r
396         MOV.L   #_ulRegTest1CycleCount, R14\r
397         MOV.L   [ R14 ], R15\r
398         ADD             #1, R15\r
399         MOV.L   R15, [ R14 ]\r
400 \r
401         ; Yield to extend the text coverage.  Set the bit in the ITU SWINTR register.\r
402         MOV.L   #1, R14\r
403         MOV.L   #0872E0H, R15\r
404         MOV.B   R14, [R15]\r
405         NOP\r
406         NOP\r
407 \r
408         ;Check the accumulator value.\r
409         MVFACHI R15\r
410         CMP             #11111111H, R15\r
411         BNE             RegTest2Error\r
412         MVFACMI R15\r
413         CMP             #11112222H, R15\r
414         BNE             RegTest2Error\r
415 \r
416         ; Restore the clobbered registers.\r
417         POPM    R14-R15\r
418 \r
419         ; Now compare each register to ensure it still contains the value that was\r
420         ; set before this loop was entered.\r
421         CMP             #1, R1\r
422         BNE             RegTest1Error\r
423         CMP             #2, R2\r
424         BNE             RegTest1Error\r
425         CMP             #3, R3\r
426         BNE             RegTest1Error\r
427         CMP             #4, R4\r
428         BNE             RegTest1Error\r
429         CMP             #5, R5\r
430         BNE             RegTest1Error\r
431         CMP             #6, R6\r
432         BNE             RegTest1Error\r
433         CMP             #7, R7\r
434         BNE             RegTest1Error\r
435         CMP             #8, R8\r
436         BNE             RegTest1Error\r
437         CMP             #9, R9\r
438         BNE             RegTest1Error\r
439         CMP             #10, R10\r
440         BNE             RegTest1Error\r
441         CMP             #11, R11\r
442         BNE             RegTest1Error\r
443         CMP             #12, R12\r
444         BNE             RegTest1Error\r
445         CMP             #13, R13\r
446         BNE             RegTest1Error\r
447         CMP             #14, R14\r
448         BNE             RegTest1Error\r
449         CMP             #15, R15\r
450         BNE             RegTest1Error\r
451 \r
452         ; All comparisons passed, start a new iteration of this loop.\r
453         BRA             TestLoop1\r
454 \r
455 RegTest1Error:\r
456         ; A compare failed, just loop here so the loop counter stops incrementing\r
457         ; causing the check timer to indicate the error.\r
458         BRA RegTest1Error\r
459 }\r
460 /*-----------------------------------------------------------*/\r
461 \r
462 /* This function is explained in the comments at the top of this file. */\r
463 #pragma inline_asm prvRegTest2Implementation\r
464 static void prvRegTest2Implementation( void )\r
465 {\r
466         ; Put a known value in each register.\r
467         MOV.L   #33333333H, R15\r
468         MVTACHI R15\r
469         MOV.L   #44444444H, R15\r
470         MVTACLO R15\r
471         MOV.L   #10, R1\r
472         MOV.L   #20, R2\r
473         MOV.L   #30, R3\r
474         MOV.L   #40, R4\r
475         MOV.L   #50, R5\r
476         MOV.L   #60, R6\r
477         MOV.L   #70, R7\r
478         MOV.L   #80, R8\r
479         MOV.L   #90, R9\r
480         MOV.L   #100, R10\r
481         MOV.L   #110, R11\r
482         MOV.L   #120, R12\r
483         MOV.L   #130, R13\r
484         MOV.L   #140, R14\r
485         MOV.L   #150, R15\r
486 \r
487         ; Loop, checking on each iteration that each register still contains the\r
488         ; expected value.\r
489 TestLoop2:\r
490 \r
491         ; Push the registers that are going to get clobbered.\r
492         PUSHM   R14-R15\r
493 \r
494         ; Increment the loop counter to show this task is still getting CPU time.\r
495         MOV.L   #_ulRegTest2CycleCount, R14\r
496         MOV.L   [ R14 ], R15\r
497         ADD             #1, R15\r
498         MOV.L   R15, [ R14 ]\r
499 \r
500         ;Check the accumulator value.\r
501         MVFACHI R15\r
502         CMP             #33333333H, R15\r
503         BNE             RegTest2Error\r
504         MVFACMI R15\r
505         CMP             #33334444H, R15\r
506         BNE             RegTest2Error\r
507 \r
508         ; Restore the clobbered registers.\r
509         POPM    R14-R15\r
510 \r
511         CMP             #10, R1\r
512         BNE             RegTest2Error\r
513         CMP             #20, R2\r
514         BNE             RegTest2Error\r
515         CMP             #30, R3\r
516         BNE             RegTest2Error\r
517         CMP             #40, R4\r
518         BNE             RegTest2Error\r
519         CMP             #50, R5\r
520         BNE             RegTest2Error\r
521         CMP             #60, R6\r
522         BNE             RegTest2Error\r
523         CMP             #70, R7\r
524         BNE             RegTest2Error\r
525         CMP             #80, R8\r
526         BNE             RegTest2Error\r
527         CMP             #90, R9\r
528         BNE             RegTest2Error\r
529         CMP             #100, R10\r
530         BNE             RegTest2Error\r
531         CMP             #110, R11\r
532         BNE             RegTest2Error\r
533         CMP             #120, R12\r
534         BNE             RegTest2Error\r
535         CMP             #130, R13\r
536         BNE             RegTest2Error\r
537         CMP             #140, R14\r
538         BNE             RegTest2Error\r
539         CMP             #150, R15\r
540         BNE             RegTest2Error\r
541 \r
542         ; All comparisons passed, start a new itteratio of this loop.\r
543         BRA             TestLoop2\r
544 \r
545 RegTest2Error:\r
546         ; A compare failed, just loop here so the loop counter stops incrementing\r
547         ; - causing the check timer to indicate the error.\r
548         BRA RegTest2Error\r
549 }\r
550 /*-----------------------------------------------------------*/\r
551 \r
552 #endif /* configCREATE_LOW_POWER_DEMO */\r