]> begriffs open source - cmsis-freertos/blob - Demo/RX700_RX71M_RSK_Renesas_e2studio/src/Full_Demo/main_full.c
Updated to FreeRTOS V10.0.1
[cmsis-freertos] / Demo / RX700_RX71M_RSK_Renesas_e2studio / src / Full_Demo / main_full.c
1 /*
2  * FreeRTOS Kernel V10.0.1
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://www.FreeRTOS.org
23  * http://aws.amazon.com/freertos
24  *
25  * 1 tab == 4 spaces!
26  */
27
28 /******************************************************************************
29  * NOTE 1:  This project provides two demo applications.  A simple blinky
30  * style project, and a more comprehensive test and demo application.  The
31  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to
32  * select between the two.  See the notes on using
33  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY in main.c.  This file implements the
34  * comprehensive version.
35  *
36  * NOTE 2:  This file only contains the source code that is specific to the
37  * full demo.  Generic functions, such FreeRTOS hook functions, and functions
38  * required to configure the hardware, are defined in main.c.
39  *
40  ******************************************************************************
41  *
42  * main_full() creates a set of demo application tasks and software timers, then
43  * starts the scheduler.  The web documentation provides more details of the
44  * standard demo application tasks, which provide no particular functionality,
45  * but do provide a good example of how to use the FreeRTOS API.
46  *
47  * In addition to the standard demo tasks, the following tasks and tests are
48  * defined and/or created within this file:
49  *
50  * "FreeRTOS+CLI command console" -  The command console uses SCI1 for its
51  * input and output.  The baud rate is set to 19200.  Type "help" to see a list
52  * of registered commands.  The FreeRTOS+CLI license is different to the
53  * FreeRTOS license, see http://www.FreeRTOS.org/cli for license and usage
54  * details.
55  *
56  * "Reg test" tasks - These fill both the core and floating point registers with
57  * known values, then check that each register maintains its expected value for
58  * the lifetime of the task.  Each task uses a different set of values.  The reg
59  * test tasks execute with a very low priority, so get preempted very
60  * frequently.  A register containing an unexpected value is indicative of an
61  * error in the context switching mechanism.
62  *
63  * "Check" task - The check task period is initially set to three seconds.  The
64  * task checks that all the standard demo tasks are not only still executing,
65  * but are executing without reporting any errors.  If the check task discovers
66  * that a task has either stalled, or reported an error, then it changes its own
67  * execution period from the initial three seconds, to just 200ms.  The check
68  * task also toggles an LED on each iteration of its loop.  This provides a
69  * visual indication of the system status:  If the LED toggles every three
70  * seconds, then no issues have been discovered.  If the LED toggles every
71  * 200ms, then an issue has been discovered with at least one task.
72  */
73
74 /* Standard includes. */
75 #include <stdio.h>
76
77 /* Kernel includes. */
78 #include "FreeRTOS.h"
79 #include "task.h"
80 #include "timers.h"
81 #include "semphr.h"
82
83 /* Standard demo application includes. */
84 #include "flop.h"
85 #include "semtest.h"
86 #include "dynamic.h"
87 #include "BlockQ.h"
88 #include "blocktim.h"
89 #include "countsem.h"
90 #include "GenQTest.h"
91 #include "recmutex.h"
92 #include "death.h"
93 #include "partest.h"
94 #include "comtest2.h"
95 #include "serial.h"
96 #include "TimerDemo.h"
97 #include "QueueOverwrite.h"
98 #include "IntQueue.h"
99 #include "EventGroupsDemo.h"
100 #include "TaskNotify.h"
101 #include "IntSemTest.h"
102
103 /* Renesas includes. */
104 #include <rskrx71mdef.h>
105 #include "r_cg_macrodriver.h"
106 #include "r_cg_userdefine.h"
107
108 /* Priorities for the demo application tasks. */
109 #define mainSEM_TEST_PRIORITY                           ( tskIDLE_PRIORITY + 1UL )
110 #define mainBLOCK_Q_PRIORITY                            ( tskIDLE_PRIORITY + 2UL )
111 #define mainCREATOR_TASK_PRIORITY                       ( tskIDLE_PRIORITY + 3UL )
112 #define mainFLOP_TASK_PRIORITY                          ( tskIDLE_PRIORITY )
113 #define mainUART_COMMAND_CONSOLE_STACK_SIZE     ( configMINIMAL_STACK_SIZE * 3UL )
114 #define mainCHECK_TASK_PRIORITY                         ( configMAX_PRIORITIES - 1 )
115 #define mainQUEUE_OVERWRITE_PRIORITY            ( tskIDLE_PRIORITY )
116
117 /* The priority used by the UART command console task. */
118 #define mainUART_COMMAND_CONSOLE_TASK_PRIORITY  ( configMAX_PRIORITIES - 2 )
119
120 /* The period of the check task, in ms, provided no errors have been reported by
121 any of the standard demo tasks.  ms are converted to the equivalent in ticks
122 using the portTICK_PERIOD_MS constant. */
123 #define mainNO_ERROR_CHECK_TASK_PERIOD          pdMS_TO_TICKS( 3000UL )
124
125 /* The period of the check task, in ms, if an error has been reported in one of
126 the standard demo tasks.  ms are converted to the equivalent in ticks using the
127 portTICK_PERIOD_MS constant. */
128 #define mainERROR_CHECK_TASK_PERIOD             pdMS_TO_TICKS( 200UL )
129
130 /* Parameters that are passed into the register check tasks solely for the
131 purpose of ensuring parameters are passed into tasks correctly. */
132 #define mainREG_TEST_1_PARAMETER                        ( ( void * ) 0x12121212UL )
133 #define mainREG_TEST_2_PARAMETER                        ( ( void * ) 0x12345678UL )
134
135 /* The base period used by the timer test tasks. */
136 #define mainTIMER_TEST_PERIOD                           ( 50 )
137
138 /*-----------------------------------------------------------*/
139
140 /*
141  * Entry point for the comprehensive demo (as opposed to the simple blinky
142  * demo).
143  */
144 void main_full( void );
145
146 /*
147  * The full demo includes some functionality called from the tick hook.
148  */
149 void vFullDemoTickHook( void );
150
151  /*
152  * The check task, as described at the top of this file.
153  */
154 static void prvCheckTask( void *pvParameters );
155
156 /*
157  * Register check tasks, and the tasks used to write over and check the contents
158  * of the registers, as described at the top of this file.  The nature of these
159  * files necessitates that they are written in assembly, but the entry points
160  * are kept in the C file for the convenience of checking the task parameter.
161  */
162 static void prvRegTest1Task( void *pvParameters );
163 static void prvRegTest2Task( void *pvParameters );
164 static void prvRegTest1Implementation( void );
165 static void prvRegTest2Implementation( void );
166
167 /*
168  * A high priority task that does nothing other than execute at a pseudo random
169  * time to ensure the other test tasks don't just execute in a repeating
170  * pattern.
171  */
172 static void prvPseudoRandomiser( void *pvParameters );
173
174 /*
175  * Register commands that can be used with FreeRTOS+CLI.  The commands are
176  * defined in CLI-Commands.c and File-Related-CLI-Command.c respectively.
177  */
178 extern void vRegisterSampleCLICommands( void );
179
180 /*
181  * The task that manages the FreeRTOS+CLI input and output.
182  */
183 extern void vUARTCommandConsoleStart( uint16_t usStackSize, UBaseType_t uxPriority );
184
185 /*-----------------------------------------------------------*/
186
187 /* The following two variables are used to communicate the status of the
188 register check tasks to the check task.  If the variables keep incrementing,
189 then the register check tasks have not discovered any errors.  If a variable
190 stops incrementing, then an error has been found. */
191 volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;
192
193 /*-----------------------------------------------------------*/
194
195 void main_full( void )
196 {
197         /* Start all the other standard demo/test tasks.  They have no particular
198         functionality, but do demonstrate how to use the FreeRTOS API and test the
199         kernel port. */
200         vStartInterruptQueueTasks();
201         vStartDynamicPriorityTasks();
202         vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
203         vCreateBlockTimeTasks();
204         vStartCountingSemaphoreTasks();
205         vStartGenericQueueTasks( tskIDLE_PRIORITY );
206         vStartRecursiveMutexTasks();
207         vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
208         vStartMathTasks( mainFLOP_TASK_PRIORITY );
209         vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
210         vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
211         vStartEventGroupTasks();
212         vStartTaskNotifyTask();
213         vStartInterruptSemaphoreTasks();
214
215         /* Create the register check tasks, as described at the top of this     file */
216         xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );
217         xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );
218
219         /* Create the task that just adds a little random behaviour. */
220         xTaskCreate( prvPseudoRandomiser, "Rnd", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 2, NULL );
221
222         /* Start the tasks that implements the command console on the UART, as
223         described above. */
224         vUARTCommandConsoleStart( mainUART_COMMAND_CONSOLE_STACK_SIZE, mainUART_COMMAND_CONSOLE_TASK_PRIORITY );
225
226         /* Register the standard CLI commands. */
227         vRegisterSampleCLICommands();
228
229         /* Create the task that performs the 'check' functionality,     as described at
230         the top of this file. */
231         xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
232
233         /* The set of tasks created by the following function call have to be
234         created last as they keep account of the number of tasks they expect to see
235         running. */
236         vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
237
238         /* Start the scheduler. */
239         vTaskStartScheduler();
240
241         /* If all is well, the scheduler will now be running, and the following
242         line will never be reached.  If the following line does execute, then
243         there was insufficient FreeRTOS heap memory available for the Idle and/or
244         timer tasks to be created.  See the memory management section on the
245         FreeRTOS web site for more details on the FreeRTOS heap
246         http://www.freertos.org/a00111.html. */
247         for( ;; );
248 }
249 /*-----------------------------------------------------------*/
250
251 static void prvCheckTask( void *pvParameters )
252 {
253 TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
254 TickType_t xLastExecutionTime;
255 static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
256 unsigned long ulErrorFound = pdFALSE;
257
258         /* Just to stop compiler warnings. */
259         ( void ) pvParameters;
260
261         /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
262         works correctly. */
263         xLastExecutionTime = xTaskGetTickCount();
264
265         /* Cycle for ever, delaying then checking all the other tasks are still
266         operating without error.  The onboard LED is toggled on each iteration.
267         If an error is detected then the delay period is decreased from
268         mainNO_ERROR_CHECK_TASK_PERIOD to mainERROR_CHECK_TASK_PERIOD.  This has the
269         effect of increasing the rate at which the onboard LED toggles, and in so
270         doing gives visual feedback of the system status. */
271         for( ;; )
272         {
273                 /* Delay until it is time to execute again. */
274                 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
275
276                 /* Check all the demo tasks (other than the flash tasks) to ensure
277                 that they are all still running, and that none have detected an error. */
278                 if( xAreIntQueueTasksStillRunning() != pdTRUE )
279                 {
280                         ulErrorFound |= 1UL << 0UL;
281                 }
282
283                 if( xAreMathsTaskStillRunning() != pdTRUE )
284                 {
285                         ulErrorFound |= 1UL << 1UL;
286                 }
287
288                 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
289                 {
290                         ulErrorFound |= 1UL << 2UL;
291                 }
292
293                 if( xAreBlockingQueuesStillRunning() != pdTRUE )
294                 {
295                         ulErrorFound |= 1UL << 3UL;
296                 }
297
298                 if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
299                 {
300                         ulErrorFound |= 1UL << 4UL;
301                 }
302
303                 if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
304                 {
305                         ulErrorFound |= 1UL << 5UL;
306                 }
307
308                 if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
309                 {
310                         ulErrorFound |= 1UL << 6UL;
311                 }
312
313                 if( xIsCreateTaskStillRunning() != pdTRUE )
314                 {
315                         ulErrorFound |= 1UL << 7UL;
316                 }
317
318                 if( xAreSemaphoreTasksStillRunning() != pdTRUE )
319                 {
320                         ulErrorFound |= 1UL << 8UL;
321                 }
322
323                 if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS )
324                 {
325                         ulErrorFound |= 1UL << 9UL;
326                 }
327
328                 if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
329                 {
330                         ulErrorFound |= 1UL << 10UL;
331                 }
332
333                 if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
334                 {
335                         ulErrorFound |= 1UL << 11UL;
336                 }
337
338                 if( xAreEventGroupTasksStillRunning() != pdPASS )
339                 {
340                         ulErrorFound |= 1UL << 12UL;
341                 }
342
343                 if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
344                 {
345                         ulErrorFound |= 1UL << 13UL;
346                 }
347
348                 if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
349                 {
350                         ulErrorFound |= 1UL << 14UL;
351                 }
352
353                 /* Check that the register test 1 task is still running. */
354                 if( ulLastRegTest1Value == ulRegTest1LoopCounter )
355                 {
356                         ulErrorFound |= 1UL << 15UL;
357                 }
358                 ulLastRegTest1Value = ulRegTest1LoopCounter;
359
360                 /* Check that the register test 2 task is still running. */
361                 if( ulLastRegTest2Value == ulRegTest2LoopCounter )
362                 {
363                         ulErrorFound |= 1UL << 16UL;
364                 }
365                 ulLastRegTest2Value = ulRegTest2LoopCounter;
366
367                 /* Toggle the check LED to give an indication of the system status.  If
368                 the LED toggles every mainNO_ERROR_CHECK_TASK_PERIOD milliseconds then
369                 everything is ok.  A faster toggle indicates an error. */
370                 LED0 = !LED0;
371
372                 if( ulErrorFound != pdFALSE )
373                 {
374                         /* An error has been detected in one of the tasks - flash the LED
375                         at a higher frequency to give visible feedback that something has
376                         gone wrong (it might just be that the loop back connector required
377                         by the comtest tasks has not been fitted). */
378                         xDelayPeriod = mainERROR_CHECK_TASK_PERIOD;
379                 }
380         }
381 }
382 /*-----------------------------------------------------------*/
383
384 static void prvPseudoRandomiser( void *pvParameters )
385 {
386 const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL, ulMinDelay = pdMS_TO_TICKS( 35 );
387 volatile uint32_t ulNextRand = ( uint32_t ) &pvParameters, ulValue;
388
389         /* This task does nothing other than ensure there is a little bit of
390         disruption in the scheduling pattern of the other tasks.  Normally this is
391         done by generating interrupts at pseudo random times. */
392         for( ;; )
393         {
394                 ulNextRand = ( ulMultiplier * ulNextRand ) + ulIncrement;
395                 ulValue = ( ulNextRand >> 16UL ) & 0xffUL;
396
397                 if( ulValue < ulMinDelay )
398                 {
399                         ulValue = ulMinDelay;
400                 }
401
402                 vTaskDelay( ulValue );
403
404                 while( ulValue > 0 )
405                 {
406                         nop();
407                         nop();
408                         nop();
409                         nop();
410                         nop();
411                         nop();
412                         nop();
413                         nop();
414
415                         ulValue--;
416                 }
417         }
418 }
419 /*-----------------------------------------------------------*/
420
421 void vFullDemoTickHook( void )
422 {
423         /* The full demo includes a software timer demo/test that requires
424         prodding periodically from the tick interrupt. */
425         vTimerPeriodicISRTests();
426
427         /* Call the periodic queue overwrite from ISR demo. */
428         vQueueOverwritePeriodicISRDemo();
429
430         /* Call the periodic event group from ISR demo. */
431         vPeriodicEventGroupsProcessing();
432
433         /* Use task notifications from an interrupt. */
434         xNotifyTaskFromISR();
435
436         /* Use mutexes from interrupts. */
437         vInterruptSemaphorePeriodicTest();
438 }
439 /*-----------------------------------------------------------*/
440
441 /* This function is explained in the comments at the top of this file. */
442 static void prvRegTest1Task( void *pvParameters )
443 {
444         if( pvParameters != mainREG_TEST_1_PARAMETER )
445         {
446                 /* The parameter did not contain the expected value. */
447                 for( ;; )
448                 {
449                         /* Stop the tick interrupt so its obvious something has gone wrong. */
450                         taskDISABLE_INTERRUPTS();
451                 }
452         }
453
454         /* This is an inline asm function that never returns. */
455         prvRegTest1Implementation();
456 }
457 /*-----------------------------------------------------------*/
458
459 /* This function is explained in the comments at the top of this file. */
460 static void prvRegTest2Task( void *pvParameters )
461 {
462         if( pvParameters != mainREG_TEST_2_PARAMETER )
463         {
464                 /* The parameter did not contain the expected value. */
465                 for( ;; )
466                 {
467                         /* Stop the tick interrupt so its obvious something has gone wrong. */
468                         taskDISABLE_INTERRUPTS();
469                 }
470         }
471
472         /* This is an inline asm function that never returns. */
473         prvRegTest2Implementation();
474 }
475 /*-----------------------------------------------------------*/
476
477 /* This function is explained in the comments at the top of this file. */
478 #pragma inline_asm prvRegTest1Implementation
479 static void prvRegTest1Implementation( void )
480 {
481         ; Put a known value in each register.
482         MOV.L   #1, R1
483         MOV.L   #2, R2
484         MOV.L   #3, R3
485         MOV.L   #4, R4
486         MOV.L   #5, R5
487         MOV.L   #6, R6
488         MOV.L   #7, R7
489         MOV.L   #8, R8
490         MOV.L   #9, R9
491         MOV.L   #10, R10
492         MOV.L   #11, R11
493         MOV.L   #12, R12
494         MOV.L   #13, R13
495         MOV.L   #14, R14
496         MOV.L   #15, R15
497
498         ; Loop, checking each iteration that each register still contains the
499         ; expected value.
500 TestLoop1:
501
502         ; Push the registers that are going to get clobbered.
503         PUSHM   R14-R15
504
505         ; Increment the loop counter to show this task is still getting CPU time.
506         MOV.L   #_ulRegTest1LoopCounter, R14
507         MOV.L   [ R14 ], R15
508         ADD             #1, R15
509         MOV.L   R15, [ R14 ]
510
511         ; Yield to extend the text coverage.  Set the bit in the ITU SWINTR register.
512         MOV.L   #1, R14
513         MOV.L   #0872E0H, R15
514         MOV.B   R14, [R15]
515         NOP
516         NOP
517
518         ; Restore the clobbered registers.
519         POPM    R14-R15
520
521         ; Now compare each register to ensure it still contains the value that was
522         ; set before this loop was entered.
523         CMP             #1, R1
524         BNE             RegTest1Error
525         CMP             #2, R2
526         BNE             RegTest1Error
527         CMP             #3, R3
528         BNE             RegTest1Error
529         CMP             #4, R4
530         BNE             RegTest1Error
531         CMP             #5, R5
532         BNE             RegTest1Error
533         CMP             #6, R6
534         BNE             RegTest1Error
535         CMP             #7, R7
536         BNE             RegTest1Error
537         CMP             #8, R8
538         BNE             RegTest1Error
539         CMP             #9, R9
540         BNE             RegTest1Error
541         CMP             #10, R10
542         BNE             RegTest1Error
543         CMP             #11, R11
544         BNE             RegTest1Error
545         CMP             #12, R12
546         BNE             RegTest1Error
547         CMP             #13, R13
548         BNE             RegTest1Error
549         CMP             #14, R14
550         BNE             RegTest1Error
551         CMP             #15, R15
552         BNE             RegTest1Error
553
554         ; All comparisons passed, start a new itteratio of this loop.
555         BRA             TestLoop1
556
557 RegTest1Error:
558         ; A compare failed, just loop here so the loop counter stops incrementing
559         ; causing the check task to indicate the error.
560         BRA RegTest1Error
561 }
562 /*-----------------------------------------------------------*/
563
564 /* This function is explained in the comments at the top of this file. */
565 #pragma inline_asm prvRegTest2Implementation
566 static void prvRegTest2Implementation( void )
567 {
568         ; Put a known value in each register.
569         MOV.L   #10, R1
570         MOV.L   #20, R2
571         MOV.L   #30, R3
572         MOV.L   #40, R4
573         MOV.L   #50, R5
574         MOV.L   #60, R6
575         MOV.L   #70, R7
576         MOV.L   #80, R8
577         MOV.L   #90, R9
578         MOV.L   #100, R10
579         MOV.L   #110, R11
580         MOV.L   #120, R12
581         MOV.L   #130, R13
582         MOV.L   #140, R14
583         MOV.L   #150, R15
584
585         ; Loop, checking on each iteration that each register still contains the
586         ; expected value.
587 TestLoop2:
588
589         ; Push the registers that are going to get clobbered.
590         PUSHM   R14-R15
591
592         ; Increment the loop counter to show this task is still getting CPU time.
593         MOV.L   #_ulRegTest2LoopCounter, R14
594         MOV.L   [ R14 ], R15
595         ADD             #1, R15
596         MOV.L   R15, [ R14 ]
597
598         ; Restore the clobbered registers.
599         POPM    R14-R15
600
601         CMP             #10, R1
602         BNE             RegTest2Error
603         CMP             #20, R2
604         BNE             RegTest2Error
605         CMP             #30, R3
606         BNE             RegTest2Error
607         CMP             #40, R4
608         BNE             RegTest2Error
609         CMP             #50, R5
610         BNE             RegTest2Error
611         CMP             #60, R6
612         BNE             RegTest2Error
613         CMP             #70, R7
614         BNE             RegTest2Error
615         CMP             #80, R8
616         BNE             RegTest2Error
617         CMP             #90, R9
618         BNE             RegTest2Error
619         CMP             #100, R10
620         BNE             RegTest2Error
621         CMP             #110, R11
622         BNE             RegTest2Error
623         CMP             #120, R12
624         BNE             RegTest2Error
625         CMP             #130, R13
626         BNE             RegTest2Error
627         CMP             #140, R14
628         BNE             RegTest2Error
629         CMP             #150, R15
630         BNE             RegTest2Error
631
632         ; All comparisons passed, start a new itteratio of this loop.
633         BRA             TestLoop2
634
635 RegTest2Error:
636         ; A compare failed, just loop here so the loop counter stops incrementing
637         ; - causing the check task to indicate the error.
638         BRA RegTest2Error
639 }
640 /*-----------------------------------------------------------*/
641
642
643
644