]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/SuperH_SH7216_Renesas/RTOSDemo/main.c
Update version numbers ready for release.
[freertos] / FreeRTOS / Demo / SuperH_SH7216_Renesas / RTOSDemo / main.c
1 /*\r
2  * FreeRTOS Kernel V10.1.1\r
3  * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28 \r
29 \r
30 /*\r
31  * Creates all the demo application tasks, then starts the scheduler.  The WEB\r
32  * documentation provides more details of the standard demo application tasks,\r
33  * which provide no particular functionality but do provide a good example of\r
34  * how to use the FreeRTOS API.  In addition to the standard demo tasks, the \r
35  * following tasks and tests are defined and/or created within this file:\r
36  *\r
37  * Webserver ("uIP") task - This serves a number of dynamically generated WEB\r
38  * pages to a standard WEB browser.  The IP and MAC addresses are configured by\r
39  * constants defined at the bottom of FreeRTOSConfig.h.  Use either a standard\r
40  * Ethernet cable to connect through a hug, or a cross over (point to point)\r
41  * cable to connect directly.  Ensure the IP address used is compatible with the\r
42  * IP address of the machine running the browser - the easiest way to achieve\r
43  * this is to ensure the first three octets of the IP addresses are the same.\r
44  *\r
45  * "Reg test" tasks - These fill the registers with known values, then check\r
46  * that each register still contains its expected value.  Each task uses\r
47  * different values.  The tasks run with very low priority so get preempted very\r
48  * frequently.  A register containing an unexpected value is indicative of an\r
49  * error in the context switching mechanism.  Both standard and floating point\r
50  * registers are checked.  The nature of the reg test tasks necessitates that\r
51  * they are written in assembly code.  They are defined in regtest.src.\r
52  *\r
53  * "math" tasks - These are a set of 8 tasks that perform various double\r
54  * precision floating point calculations in order to check that the tasks \r
55  * floating point registers are being correctly saved and restored during\r
56  * context switches.  The math tasks are defined in flop.c.\r
57  *\r
58  * "Check" task - This only executes every five seconds but has a high priority\r
59  * to ensure it gets processor time.  Its main function is to check that all the\r
60  * standard demo tasks are still operational.  While no errors have been\r
61  * discovered the check task will toggle an LED every 5 seconds - the toggle\r
62  * rate increasing to 200ms being a visual indication that at least one task has\r
63  * reported unexpected behaviour.\r
64  *\r
65  * *NOTE 1* If LED5 is toggling every 5 seconds then all the demo application\r
66  * tasks are executing as expected and no errors have been reported in any \r
67  * tasks.  The toggle rate increasing to 200ms indicates that at least one task\r
68  * has reported unexpected behaviour.\r
69  * \r
70  * *NOTE 2* This file and flop.c both demonstrate the use of \r
71  * xPortUsesFloatingPoint() which informs the kernel that a task should maintain\r
72  * a floating point context.\r
73  *\r
74  * *NOTE 3* vApplicationSetupTimerInterrupt() is called by the kernel to let\r
75  * the application set up a timer to generate the tick interrupt.  In this\r
76  * example a compare match timer is used for this purpose.  \r
77  * vApplicationTickHook() is used to clear the timer interrupt and relies on\r
78  * configUSE_TICK_HOOK being set to 1 in FreeRTOSConfig.h.\r
79  *\r
80  * *NOTE 4* The traceTASK_SWITCHED_IN and traceTASK_SWITCHED_OUT trace hooks\r
81  * are used to save and restore the floating point context respectively for\r
82  * those tasks that require it (those for which xPortUsesFloatingPoint() has\r
83  * been called).\r
84  * \r
85  * *NOTE 5* Any interrupt that can cause a context switch requires an asm \r
86  * wrapper and must be assigned an interrupt priority of \r
87  * portKERNEL_INTERRUPT_PRIORITY.\r
88  *\r
89  * *NOTE 6* vSetupClockForRunTimeStats() is called by the kernel (via the \r
90  * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()) macro to configure an MTU channel\r
91  * to produce a time base that is used to log how much processor time each task\r
92  * is consuming.  The MTU is used to generate a high(ish) frequency interrupt,\r
93  * and so also provides an example of how interrupts that don't make use of the\r
94  * FreeRTOS kernel can be assigned a priority above any priority used by the\r
95  * kernel itself.\r
96  */\r
97 \r
98 /* Kernel includes. */\r
99 #include "FreeRTOS.h"\r
100 #include "task.h"\r
101 \r
102 /* Demo application includes. */\r
103 #include "BlockQ.h"\r
104 #include "death.h"\r
105 #include "integer.h"\r
106 #include "blocktim.h"\r
107 #include "flash.h"\r
108 #include "partest.h"\r
109 #include "semtest.h"\r
110 #include "PollQ.h"\r
111 #include "GenQTest.h"\r
112 #include "QPeek.h"\r
113 #include "recmutex.h"\r
114 #include "flop.h"\r
115 \r
116 /* Constants required to configure the hardware. */\r
117 #define mainFRQCR_VALUE                                         ( 0x0303 )      /* Input = 12.5MHz, I Clock = 200MHz, B Clock = 50MHz, P Clock = 50MHz */\r
118 \r
119 /* Task priorities. */\r
120 #define mainQUEUE_POLL_PRIORITY                         ( tskIDLE_PRIORITY + 1 )\r
121 #define mainCHECK_TASK_PRIORITY                         ( tskIDLE_PRIORITY + 3 )\r
122 #define mainSEM_TEST_PRIORITY                           ( tskIDLE_PRIORITY + 1 )\r
123 #define mainBLOCK_Q_PRIORITY                            ( tskIDLE_PRIORITY + 2 )\r
124 #define mainCREATOR_TASK_PRIORITY           ( tskIDLE_PRIORITY + 3 )\r
125 #define mainFLASH_TASK_PRIORITY                         ( tskIDLE_PRIORITY + 1 )\r
126 #define mainuIP_TASK_PRIORITY                           ( tskIDLE_PRIORITY + 2 )\r
127 #define mainINTEGER_TASK_PRIORITY           ( tskIDLE_PRIORITY )\r
128 #define mainGEN_QUEUE_TASK_PRIORITY                     ( tskIDLE_PRIORITY )\r
129 #define mainFLOP_TASK_PRIORITY                          ( tskIDLE_PRIORITY )\r
130 \r
131 /* The WEB server uses string handling functions, which in turn use a bit more\r
132 stack than most of the other tasks. */\r
133 #define mainuIP_STACK_SIZE                                      ( configMINIMAL_STACK_SIZE * 3 )\r
134 \r
135 /* The LED toggled by the check task. */\r
136 #define mainCHECK_LED                                           ( 5 )\r
137 \r
138 /* The rate at which mainCHECK_LED will toggle when all the tasks are running\r
139 without error. */\r
140 #define mainNO_ERROR_CYCLE_TIME                         ( 5000 / portTICK_PERIOD_MS )\r
141 \r
142 /* The rate at which mainCHECK_LED will toggle when an error has been reported\r
143 by at least one task. */\r
144 #define mainERROR_CYCLE_TIME                            ( 200 / portTICK_PERIOD_MS )\r
145 \r
146 /*\r
147  * vApplicationMallocFailedHook() will only be called if\r
148  * configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
149  * function that will execute if a call to pvPortMalloc() fails.\r
150  * pvPortMalloc() is called internally by the kernel whenever a task, queue or\r
151  * semaphore is created.  It is also called by various parts of the demo\r
152  * application.  \r
153  */\r
154 void vApplicationMallocFailedHook( void );\r
155 \r
156 /*\r
157  * vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set to 1\r
158  * in FreeRTOSConfig.h.  It is a hook function that is called on each iteration\r
159  * of the idle task.  It is essential that code added to this hook function\r
160  * never attempts to block in any way (for example, call xQueueReceive() with\r
161  * a block time specified).  If the application makes use of the vTaskDelete()\r
162  * API function (as this demo application does) then it is also important that\r
163  * vApplicationIdleHook() is permitted to return to its calling function because\r
164  * it is the responsibility of the idle task to clean up memory allocated by the\r
165  * kernel to any task that has since been deleted.\r
166  */\r
167 void vApplicationIdleHook( void );\r
168 \r
169 /*\r
170  * Just sets up clocks, ports, etc. used by the demo application.\r
171  */\r
172 static void prvSetupHardware( void );\r
173 \r
174 /*\r
175  * The check task as described at the top of this file.\r
176  */\r
177 static void prvCheckTask( void *pvParameters );\r
178 \r
179 /*\r
180  * The reg test tasks as described at the top of this file.\r
181  */\r
182 extern void vRegTest1Task( void *pvParameters );\r
183 extern void vRegTest2Task( void *pvParameters );\r
184 \r
185 /*\r
186  * Contains the implementation of the WEB server.\r
187  */\r
188 extern void vuIP_Task( void *pvParameters );\r
189 \r
190 /*\r
191  * The interrupt handler for the MTU - which is used to maintain the time base\r
192  * used by the run time stats.\r
193  */\r
194 #pragma interrupt MTU_Match\r
195 void MTU_Match( void );\r
196 \r
197 /*-----------------------------------------------------------*/\r
198 \r
199 /* Variables that are incremented on each iteration of the reg test tasks - \r
200 provided the tasks have not reported any errors.  The check task inspects these\r
201 variables to ensure they are still incrementing as expected. */\r
202 volatile unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;\r
203 \r
204 /* The status message that is displayed at the bottom of the "task stats" WEB\r
205 page, which is served by the uIP task. */\r
206 const char *pcStatusMessage = "All tasks executing without error.";\r
207 \r
208 /* The time use for the run time stats. */\r
209 unsigned long ulRunTime = 0UL;\r
210 \r
211 /*-----------------------------------------------------------*/\r
212 \r
213 /*\r
214  * Creates the majority of the demo application tasks before starting the\r
215  * scheduler.\r
216  */\r
217 void main(void)\r
218 {\r
219 TaskHandle_t xCreatedTask;\r
220 \r
221         prvSetupHardware();\r
222 \r
223         /* Start the reg test tasks which test the context switching mechanism. */\r
224         xTaskCreate( vRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCreatedTask );\r
225         xPortUsesFloatingPoint( xCreatedTask );\r
226         \r
227         xTaskCreate( vRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCreatedTask );\r
228         xPortUsesFloatingPoint( xCreatedTask );\r
229 \r
230         xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
231 \r
232         /* Start the check task as described at the top of this file. */\r
233         xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
234 \r
235         /* Start the standard demo tasks.  These don't perform any particular useful\r
236         functionality, other than to demonstrate the FreeRTOS API being used. */\r
237         vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
238         vCreateBlockTimeTasks();\r
239     vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
240     vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
241     vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
242     vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
243         vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
244     vStartQueuePeekTasks();\r
245         vStartRecursiveMutexTasks();\r
246         \r
247         /* Start the math tasks as described at the top of this file. */\r
248         vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
249 \r
250         /* The suicide tasks must be created last as they need to know how many\r
251         tasks were running prior to their creation in order to ascertain whether\r
252         or not the correct/expected number of tasks are running at any given time. */\r
253     vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
254 \r
255         /* Start the tasks running. */\r
256         vTaskStartScheduler();\r
257 \r
258         /* Will only get here if there was insufficient heap memory to create the idle\r
259     task.  Increase the configTOTAL_HEAP_SIZE setting in FreeRTOSConfig.h. */\r
260         for( ;; );\r
261 }\r
262 /*-----------------------------------------------------------*/\r
263 \r
264 static void prvCheckTask( void *pvParameter )\r
265 {\r
266 TickType_t xNextWakeTime, xCycleFrequency = mainNO_ERROR_CYCLE_TIME;\r
267 unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;\r
268 \r
269         /* Just to remove compiler warning. */\r
270         ( void ) pvParameter;\r
271 \r
272         /* Initialise xNextWakeTime - this only needs to be done once. */\r
273         xNextWakeTime = xTaskGetTickCount();\r
274 \r
275         for( ;; )\r
276         {\r
277                 /* Place this task in the blocked state until it is time to run again. */\r
278                 vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );\r
279                 \r
280                 /* Inspect all the other tasks to ensure none have experienced any errors. */\r
281                 if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
282                 {\r
283                         /* Increase the rate at which this task cycles, which will increase the\r
284                         rate at which mainCHECK_LED flashes to give visual feedback that an error\r
285                         has occurred. */\r
286                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
287                         pcStatusMessage = "Error in GenQ test.";\r
288                 }\r
289                 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
290                 {\r
291                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
292                         pcStatusMessage = "Error in Queue Peek test.";\r
293                 }\r
294                 else if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
295                 {\r
296                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
297                         pcStatusMessage = "Error in Blocking Queue test.";\r
298                 }\r
299                 else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
300                 {\r
301                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
302                         pcStatusMessage = "Error in BlockTim test.";\r
303                 }\r
304             else if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
305             {\r
306                 xCycleFrequency = mainERROR_CYCLE_TIME;\r
307                         pcStatusMessage = "Error in Semaphore test.";\r
308             }\r
309             else if( xArePollingQueuesStillRunning() != pdTRUE )\r
310             {\r
311                 xCycleFrequency = mainERROR_CYCLE_TIME;\r
312                         pcStatusMessage = "Error in Polling Queue test.";\r
313             }\r
314             else if( xIsCreateTaskStillRunning() != pdTRUE )\r
315             {\r
316                 xCycleFrequency = mainERROR_CYCLE_TIME;\r
317                         pcStatusMessage = "Error in Create test.";\r
318             }\r
319             else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
320             {\r
321                 xCycleFrequency = mainERROR_CYCLE_TIME;\r
322                         pcStatusMessage = "Error in integer Math test.";\r
323             }\r
324             else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
325             {\r
326                 xCycleFrequency = mainERROR_CYCLE_TIME;\r
327                         pcStatusMessage = "Error in recursive mutex test.";\r
328             }\r
329                 else if( xAreMathsTaskStillRunning() != pdTRUE )\r
330                 {\r
331                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
332                         pcStatusMessage = "Error in floating point Math test.";\r
333                 }\r
334 \r
335                 /* Check the reg test tasks are still cycling.  They will stop incrementing\r
336                 their loop counters if they encounter an error. */\r
337                 if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )\r
338                 {\r
339                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
340                         pcStatusMessage = "Error in RegTest.";\r
341                 }\r
342 \r
343                 if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )\r
344                 {\r
345                         xCycleFrequency = mainERROR_CYCLE_TIME;\r
346                         pcStatusMessage = "Error in RegTest.";\r
347                 }\r
348                 \r
349                 ulLastRegTest1CycleCount = ulRegTest1CycleCount;\r
350                 ulLastRegTest2CycleCount = ulRegTest2CycleCount;\r
351                 \r
352                 /* Toggle the check LED to give an indication of the system status.  If the\r
353                 LED toggles every 5 seconds then everything is ok.  A faster toggle indicates\r
354                 an error. */\r
355                 vParTestToggleLED( mainCHECK_LED );\r
356         }\r
357 }\r
358 /*-----------------------------------------------------------*/\r
359 \r
360 void vApplicationMallocFailedHook( void )\r
361 {\r
362         /* A call to vPortMalloc() failed, probably during the creation of a task,\r
363         queue or semaphore.  Inspect pxCurrentTCB to find which task is currently\r
364         executing. */\r
365         for( ;; );\r
366 }\r
367 /*-----------------------------------------------------------*/\r
368 \r
369 void vApplicationIdleHook( void )\r
370 {\r
371         /* Code can be added to the idle task here.  This function must *NOT* attempt\r
372         to block.  Also, if the application uses the vTaskDelete() API function then\r
373         this function must return regularly to ensure the idle task gets a chance to\r
374         clean up the memory used by deleted tasks. */\r
375 }\r
376 /*-----------------------------------------------------------*/\r
377 \r
378 void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
379 {\r
380         /* Just to remove compiler warnings.  This function will only actually\r
381         get called if configCHECK_FOR_STACK_OVERFLOW is set to a non zero value.\r
382         By default this demo does not use the stack overflow checking functionality\r
383         as the SuperH will normally execute an exception if the stack overflows. */\r
384         ( void ) pxTask;\r
385         ( void ) pcTaskName;\r
386         \r
387         taskDISABLE_INTERRUPTS();\r
388         for( ;; );\r
389 }\r
390 /*-----------------------------------------------------------*/\r
391 \r
392 static void prvSetupHardware( void )\r
393 {\r
394 volatile unsigned long ul;\r
395 \r
396         /* Set the CPU and peripheral clocks. */\r
397         CPG.FRQCR.WORD = mainFRQCR_VALUE;\r
398         \r
399         /* Wait for the clock to settle. */\r
400         for( ul = 0; ul < 99; ul++ )\r
401         {\r
402                 nop();\r
403         }\r
404 \r
405         /* Initialise the ports used to toggle LEDs. */\r
406         vParTestInitialise();   \r
407 }\r
408 /*-----------------------------------------------------------*/\r
409 \r
410 void vApplicationSetupTimerInterrupt( void )\r
411 {\r
412 /* The peripheral clock is divided by 32 before feeding the compare match\r
413 peripheral (CMT). */\r
414 const unsigned long ulCompareMatch = ( configPERIPHERAL_CLOCK_HZ / ( configTICK_RATE_HZ * 32 ) ) + 1;\r
415 \r
416         /* Configure a timer to create the RTOS tick interrupt.  This example uses\r
417         the compare match timer, but the multi function timer or possible even the\r
418         watchdog timer could also be used.  Ensure vPortTickInterrupt() is installed\r
419         as the interrupt handler for whichever peripheral is used. */\r
420         \r
421         /* Turn the CMT on. */\r
422         STB.CR4.BIT._CMT = 0;\r
423         \r
424         /* Set the compare match value for the required tick frequency. */\r
425         CMT0.CMCOR = ( unsigned short ) ulCompareMatch;\r
426         \r
427         /* Divide the peripheral clock by 32. */\r
428         CMT0.CMCSR.BIT.CKS = 0x01;\r
429         \r
430         /* Set the CMT interrupt priority - the interrupt priority must be\r
431         configKERNEL_INTERRUPT_PRIORITY no matter which peripheral is used to generate\r
432         the tick interrupt. */\r
433         INTC.IPR08.BIT._CMT0 = portKERNEL_INTERRUPT_PRIORITY;\r
434         \r
435         /* Clear the interrupt flag. */\r
436         CMT0.CMCSR.BIT.CMF = 0;\r
437         \r
438         /* Enable the compare match interrupt. */\r
439         CMT0.CMCSR.BIT.CMIE = 0x01;\r
440         \r
441         /* Start the timer. */\r
442         CMT.CMSTR.BIT.STR0 = 0x01;\r
443 }\r
444 /*-----------------------------------------------------------*/\r
445 \r
446 void vApplicationTickHook( void )\r
447 {\r
448         /* Clear the tick inerrupt.  This is called from an interrupt context. */\r
449         CMT0.CMCSR.BIT.CMF = 0;\r
450 }\r
451 /*-----------------------------------------------------------*/\r
452 \r
453 void vSetupClockForRunTimeStats( void )\r
454 {\r
455         /* Configure an MTU channel to generate a periodic interrupt that is used\r
456         as the run time stats time base.  The run time stats keep a track of how\r
457         much processing time each task is using. */\r
458 \r
459         /* Turn the MTU2 on. */\r
460         STB.CR3.BIT._MTU2 = 0;\r
461                 \r
462         /* Clear counter on compare match A. */\r
463         MTU20.TCR.BIT.CCLR = 0x01;\r
464         \r
465         /* Compare match value to give very approximately 10 interrupts per \r
466         millisecond. */\r
467         MTU20.TGRA = 5000;\r
468         \r
469         /* Ensure the interrupt is clear. */\r
470         MTU20.TSR.BIT.TGFA = 0;\r
471                 \r
472         /* Enable the compare match interrupt. */\r
473         MTU20.TIER.BIT.TGIEA = 0x01;    \r
474         \r
475         /* Set the interrupt priority. */\r
476         INTC.IPR09.BIT._MTU20G = portKERNEL_INTERRUPT_PRIORITY + 1;\r
477         \r
478         /* Start the count. */\r
479         MTU2.TSTR.BIT.CST0 = 1;\r
480 }\r
481 /*-----------------------------------------------------------*/\r
482 \r
483 void MTU_Match( void )\r
484 {\r
485 volatile unsigned char ucStatus;\r
486 \r
487         /* Increment the run time stats time base. */\r
488         ulRunTime++;\r
489 \r
490         /* Clear the interrupt. */\r
491         ucStatus = MTU20.TSR.BYTE;\r
492         MTU20.TSR.BIT.TGFA = 0;\r
493 }\r
494 /*-----------------------------------------------------------*/\r
495 \r
496 char *pcGetTaskStatusMessage( void )\r
497 {\r
498         /* Not bothered about a critical section here.  This just returns a string\r
499         that is displaed on the "Task Stats" WEB page served by this demo. */\r
500         return pcStatusMessage;\r
501 }\r
502 /*-----------------------------------------------------------*/\r