]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/PC/main.c
Update FreeRTOS version number to V7.5.3
[freertos] / FreeRTOS / Demo / PC / main.c
1 /*\r
2     FreeRTOS V7.5.3 - Copyright (C) 2013 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     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS provides completely free yet professionally developed,    *\r
10      *    robust, strictly quality controlled, supported, and cross          *\r
11      *    platform software that has become a de facto standard.             *\r
12      *                                                                       *\r
13      *    Help yourself get started quickly and support the FreeRTOS         *\r
14      *    project by purchasing a FreeRTOS tutorial book, reference          *\r
15      *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
16      *                                                                       *\r
17      *    Thank you!                                                         *\r
18      *                                                                       *\r
19     ***************************************************************************\r
20 \r
21     This file is part of the FreeRTOS distribution.\r
22 \r
23     FreeRTOS is free software; you can redistribute it and/or modify it under\r
24     the terms of the GNU General Public License (version 2) as published by the\r
25     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
26 \r
27     >>! NOTE: The modification to the GPL is included to allow you to distribute\r
28     >>! a combined work that includes FreeRTOS without being obliged to provide\r
29     >>! the source code for proprietary components outside of the FreeRTOS\r
30     >>! kernel.\r
31 \r
32     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
33     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
34     FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
35     link: http://www.freertos.org/a00114.html\r
36 \r
37     1 tab == 4 spaces!\r
38 \r
39     ***************************************************************************\r
40      *                                                                       *\r
41      *    Having a problem?  Start by reading the FAQ "My application does   *\r
42      *    not run, what could be wrong?"                                     *\r
43      *                                                                       *\r
44      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
45      *                                                                       *\r
46     ***************************************************************************\r
47 \r
48     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
49     license and Real Time Engineers Ltd. contact details.\r
50 \r
51     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
52     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
53     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
54 \r
55     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
56     Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
57     licenses offer ticketed support, indemnification and middleware.\r
58 \r
59     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
60     engineered and independently SIL3 certified version for use in safety and\r
61     mission critical applications that require provable dependability.\r
62 \r
63     1 tab == 4 spaces!\r
64 */\r
65 \r
66 /**\r
67  * Creates all the demo application tasks and co-routines, then starts the \r
68  * scheduler.\r
69  *\r
70  * Main. c also creates a task called "Print".  This only executes every \r
71  * five seconds but has the highest priority so is guaranteed to get \r
72  * processor time.  Its main function is to check that all the other tasks \r
73  * are still operational.  Nearly all the tasks in the demo application \r
74  * maintain a unique count that is incremented each time the task successfully \r
75  * completes its function.  Should any error occur within the task the count is \r
76  * permanently halted.  The print task checks the count of each task to ensure \r
77  * it has changed since the last time the print task executed.  If any count is \r
78  * found not to have changed the print task displays an appropriate message.  \r
79  * If all the tasks are still incrementing their unique counts the print task \r
80  * displays an "OK" message.\r
81  *\r
82  * The LED flash tasks do not maintain a count as they already provide visual \r
83  * feedback of their status.\r
84  *\r
85  * The print task blocks on the queue into which messages that require \r
86  * displaying are posted.  It will therefore only block for the full 5 seconds\r
87  * if no messages are posted onto the queue.\r
88  *\r
89  * Main. c also provides a demonstration of how the trace visualisation utility\r
90  * can be used, and how the scheduler can be stopped.\r
91  *\r
92  * \page MainC main.c\r
93  * \ingroup DemoFiles\r
94  * <HR>\r
95  */\r
96 \r
97 #include <stdlib.h>\r
98 #include <conio.h>\r
99 #include "FreeRTOS.h"\r
100 #include "task.h"\r
101 #include "croutine.h"\r
102 #include "partest.h"\r
103 #include "serial.h"\r
104 \r
105 /* Demo file headers. */\r
106 #include "BlockQ.h"\r
107 #include "PollQ.h"\r
108 #include "death.h"\r
109 #include "crflash.h"\r
110 #include "flop.h"\r
111 #include "print.h"\r
112 #include "comtest.h"\r
113 #include "fileio.h"\r
114 #include "semtest.h"\r
115 #include "integer.h"\r
116 #include "dynamic.h"\r
117 #include "mevents.h"\r
118 #include "crhook.h"\r
119 #include "blocktim.h"\r
120 #include "AltBlock.h"\r
121 #include "GenQTest.h"\r
122 #include "QPeek.h"\r
123 #include "countsem.h"\r
124 #include "AltQTest.h"\r
125 #include "AltPollQ.h"\r
126 #include "AltBlckQ.h"\r
127 #include "RecMutex.h"\r
128 \r
129 /* Priority definitions for the tasks in the demo application. */\r
130 #define mainLED_TASK_PRIORITY           ( tskIDLE_PRIORITY + 1 )\r
131 #define mainCREATOR_TASK_PRIORITY       ( tskIDLE_PRIORITY + 3 )\r
132 #define mainPRINT_TASK_PRIORITY         ( tskIDLE_PRIORITY + 4 )\r
133 #define mainQUEUE_POLL_PRIORITY         ( tskIDLE_PRIORITY + 2 )\r
134 #define mainQUEUE_BLOCK_PRIORITY        ( tskIDLE_PRIORITY + 3 )\r
135 #define mainCOM_TEST_PRIORITY           ( tskIDLE_PRIORITY + 2 )\r
136 #define mainSEMAPHORE_TASK_PRIORITY     ( tskIDLE_PRIORITY + 1 )\r
137 #define mainGENERIC_QUEUE_PRIORITY      ( tskIDLE_PRIORITY )\r
138 \r
139 #define mainPRINT_STACK_SIZE            ( ( unsigned short ) 512 )\r
140 #define mainDEBUG_LOG_BUFFER_SIZE       ( ( unsigned short ) 20480 )\r
141 \r
142 /* The number of flash co-routines to create. */\r
143 #define mainNUM_FLASH_CO_ROUTINES       ( 8 )\r
144 \r
145 /* Task function for the "Print" task as described at the top of the file. */\r
146 static void vErrorChecks( void *pvParameters );\r
147 \r
148 /* Function that checks the unique count of all the other tasks as described at\r
149 the top of the file. */\r
150 static void prvCheckOtherTasksAreStillRunning( void );\r
151 \r
152 /* Key presses can be used to start/stop the trace visualisation utility or stop\r
153 the scheduler. */\r
154 static void     prvCheckForKeyPresses( void );\r
155 \r
156 /* Buffer used by the trace visualisation utility so only needed if the trace\r
157 being used. */\r
158 #if configUSE_TRACE_FACILITY == 1\r
159         static char pcWriteBuffer[ mainDEBUG_LOG_BUFFER_SIZE ];\r
160 #endif\r
161 \r
162 /* Constant definition used to turn on/off the pre-emptive scheduler. */\r
163 static const short sUsingPreemption = configUSE_PREEMPTION;\r
164 \r
165 /* Start the math tasks appropriate to the build.  The Borland port does\r
166 not yet support floating point so uses the integer equivalent. */\r
167 static void prvStartMathTasks( void );\r
168 \r
169 /* Check which ever tasks are relevant to this build. */\r
170 static portBASE_TYPE prvCheckMathTasksAreStillRunning( void );\r
171 \r
172 /* Used to demonstrate the "task switched in" callback function. */\r
173 static portBASE_TYPE prvExampleTaskHook( void * pvParameter );\r
174 \r
175 /* Just used to count the number of times the example task callback function is\r
176 called, and the number of times a queue send passes. */\r
177 static unsigned long long uxCheckTaskHookCallCount = 0;\r
178 static unsigned long long uxQueueSendPassedCount = 0;\r
179 \r
180 /*-----------------------------------------------------------*/\r
181 \r
182 short main( void )\r
183 {\r
184         /* Initialise hardware and utilities. */\r
185         vParTestInitialise();\r
186         vPrintInitialise();\r
187         \r
188         /* CREATE ALL THE DEMO APPLICATION TASKS. */\r
189         prvStartMathTasks();\r
190         vStartComTestTasks( mainCOM_TEST_PRIORITY, serCOM1, ser115200 );\r
191         vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
192         vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );\r
193         vCreateBlockTimeTasks();\r
194         vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
195         vStartSemaphoreTasks( mainSEMAPHORE_TASK_PRIORITY );\r
196         vStartDynamicPriorityTasks();\r
197         vStartMultiEventTasks();\r
198         vStartQueuePeekTasks();\r
199         vStartCountingSemaphoreTasks();\r
200         vStartAltGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
201         vCreateAltBlockTimeTasks();\r
202         vStartAltBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );        \r
203         vStartAltPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
204         vStartRecursiveMutexTasks();\r
205                 \r
206         /* Create the "Print" task as described at the top of the file. */\r
207         xTaskCreate( vErrorChecks, "Print", mainPRINT_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );\r
208 \r
209         /* This task has to be created last as it keeps account of the number of tasks\r
210         it expects to see running. */\r
211         vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
212 \r
213         /* Create the co-routines that flash the LED's. */\r
214         vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );\r
215 \r
216         /* Create the co-routines that communicate with the tick hook. */\r
217         vStartHookCoRoutines();\r
218 \r
219         /* Set the scheduler running.  This function will not return unless a task\r
220         calls vTaskEndScheduler(). */\r
221         vTaskStartScheduler();\r
222 \r
223         return 1;\r
224 }\r
225 /*-----------------------------------------------------------*/\r
226 \r
227 static portBASE_TYPE prvExampleTaskHook( void * pvParameter )\r
228 {\r
229         if( pvParameter != ( void * ) 0xabcd )\r
230         {\r
231                 /* The parameter did not contain the value we expected, so cause an\r
232                 error to be detected by setting the call count back to zero. */\r
233                 uxCheckTaskHookCallCount = 0;\r
234         }\r
235         else\r
236         {\r
237                 /* Simply increment a number so we know the callback has been executed. */\r
238                 uxCheckTaskHookCallCount++;\r
239         }\r
240 \r
241         return 0;\r
242 }\r
243 /*-----------------------------------------------------------*/\r
244 \r
245 void vMainQueueSendPassed( void )\r
246 {\r
247         /* This is just an example implementation of the "queue send" trace hook. */\r
248         uxQueueSendPassedCount++;\r
249 }\r
250 /*-----------------------------------------------------------*/\r
251 \r
252 static void vErrorChecks( void *pvParameters )\r
253 {\r
254 portTickType xExpectedWakeTime;\r
255 const portTickType xPrintRate = ( portTickType ) 5000 / portTICK_RATE_MS;\r
256 const long lMaxAllowableTimeDifference = ( long ) 0;\r
257 portTickType xWakeTime;\r
258 long lTimeDifference;\r
259 const char *pcReceivedMessage;\r
260 const char * const pcTaskBlockedTooLongMsg = "Print task blocked too long!\r\n";\r
261 const char * const pcUnexpectedHookValueMsg = "Task hook has unexpected value!\r\n";\r
262 \r
263         ( void ) pvParameters;\r
264 \r
265         /* Register our callback function. */\r
266         vTaskSetApplicationTaskTag( NULL, prvExampleTaskHook );\r
267         \r
268         /* Just for test purposes. */\r
269         if( xTaskGetApplicationTaskTag( NULL ) != prvExampleTaskHook )\r
270         {\r
271                 vPrintDisplayMessage( &pcUnexpectedHookValueMsg );\r
272         }\r
273 \r
274         /* Loop continuously, blocking, then checking all the other tasks are still\r
275         running, before blocking once again.  This task blocks on the queue of\r
276         messages that require displaying so will wake either by its time out expiring,\r
277         or a message becoming available. */\r
278         for( ;; )\r
279         {\r
280                 /* Calculate the time we will unblock if no messages are received\r
281                 on the queue.  This is used to check that we have not blocked for too long. */\r
282                 xExpectedWakeTime = xTaskGetTickCount();\r
283                 xExpectedWakeTime += xPrintRate;\r
284 \r
285                 /* Block waiting for either a time out or a message to be posted that\r
286                 required displaying. */\r
287                 pcReceivedMessage = pcPrintGetNextMessage( xPrintRate );\r
288 \r
289                 /* Was a message received? */\r
290                 if( pcReceivedMessage == NULL )\r
291                 {\r
292                         /* A message was not received so we timed out, did we unblock at the\r
293                         expected time? */\r
294                         xWakeTime = xTaskGetTickCount();\r
295 \r
296                         /* Calculate the difference between the time we unblocked and the\r
297                         time we should have unblocked. */\r
298                         if( xWakeTime > xExpectedWakeTime )\r
299                         {\r
300                                 lTimeDifference = ( long ) ( xWakeTime - xExpectedWakeTime );\r
301                         }\r
302                         else\r
303                         {\r
304                                 lTimeDifference = ( long ) ( xExpectedWakeTime - xWakeTime );\r
305                         }\r
306 \r
307                         if( lTimeDifference > lMaxAllowableTimeDifference )\r
308                         {\r
309                                 /* We blocked too long - create a message that will get\r
310                                 printed out the next time around.  If we are not using\r
311                                 preemption then we won't expect the timing to be so\r
312                                 accurate. */\r
313                                 if( sUsingPreemption == pdTRUE )\r
314                                 {\r
315                                         vPrintDisplayMessage( &pcTaskBlockedTooLongMsg );\r
316                                 }\r
317                         }\r
318 \r
319                         /* Check the other tasks are still running, just in case. */\r
320                         prvCheckOtherTasksAreStillRunning();\r
321                 }\r
322                 else\r
323                 {\r
324                         /* We unblocked due to a message becoming available.  Send the message\r
325                         for printing. */\r
326                         vDisplayMessage( pcReceivedMessage );\r
327                 }\r
328 \r
329                 /* Key presses are used to invoke the trace visualisation utility, or end\r
330                 the program. */\r
331                 prvCheckForKeyPresses();\r
332         }\r
333 }\r
334 /*-----------------------------------------------------------*/\r
335 \r
336 static void     prvCheckForKeyPresses( void )\r
337 {\r
338 short sIn;\r
339 \r
340         taskENTER_CRITICAL();\r
341                 #ifdef DEBUG_BUILD\r
342                         /* kbhit can be used in .exe's that are executed from the command\r
343                         line, but not if executed through the debugger. */\r
344                         sIn = 0;\r
345                 #else\r
346                         sIn = kbhit();\r
347                 #endif\r
348         taskEXIT_CRITICAL();\r
349 \r
350         if( sIn )\r
351         {\r
352                 /* Key presses can be used to start/stop the trace utility, or end the \r
353                 program. */\r
354                 sIn = getch();\r
355                 switch( sIn )\r
356                 {\r
357                         /* Only define keys for turning on and off the trace if the trace\r
358                         is being used. */\r
359                         #if configUSE_TRACE_FACILITY == 1\r
360                                 case 't' :      vTaskList( pcWriteBuffer );\r
361                                                         vWriteMessageToDisk( pcWriteBuffer );\r
362                                                         break;\r
363                                 /* The legacy trace is no longer supported.  Use FreeRTOS+Trace instead\r
364                                 case 's' :      vTaskStartTrace( pcWriteBuffer, mainDEBUG_LOG_BUFFER_SIZE );\r
365                                                         break;\r
366 \r
367                                 case 'e' :      {\r
368                                                                 unsigned long ulBufferLength;\r
369                                                                 ulBufferLength = ulTaskEndTrace();\r
370                                                                 vWriteBufferToDisk( pcWriteBuffer, ulBufferLength );\r
371                                                         }\r
372                                                         break;\r
373                                 */\r
374                         #endif\r
375 \r
376                         default  :      vTaskEndScheduler();\r
377                                                 break;\r
378                 }\r
379         }\r
380 }\r
381 /*-----------------------------------------------------------*/\r
382 \r
383 static void prvCheckOtherTasksAreStillRunning( void )\r
384 {\r
385 static short sErrorHasOccurred = pdFALSE;\r
386 static unsigned long long uxLastHookCallCount = 0, uxLastQueueSendCount = 0;\r
387 \r
388         if( prvCheckMathTasksAreStillRunning() != pdTRUE )\r
389         {\r
390                 vDisplayMessage( "Maths task count unchanged!\r\n" );\r
391                 sErrorHasOccurred = pdTRUE;\r
392         }\r
393 \r
394         if( xAreComTestTasksStillRunning() != pdTRUE )\r
395         {\r
396                 vDisplayMessage( "Com test count unchanged!\r\n" );\r
397                 sErrorHasOccurred = pdTRUE;\r
398         }\r
399 \r
400         if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
401         {\r
402                 vDisplayMessage( "Blocking queues count unchanged!\r\n" );\r
403                 sErrorHasOccurred = pdTRUE;\r
404         }\r
405 \r
406         if( xAreAltBlockingQueuesStillRunning() != pdTRUE )\r
407         {\r
408                 vDisplayMessage( "Alt blocking queues count unchanged!\r\n" );\r
409                 sErrorHasOccurred = pdTRUE;\r
410         }\r
411 \r
412         if( xArePollingQueuesStillRunning() != pdTRUE )\r
413         {\r
414                 vDisplayMessage( "Polling queue count unchanged!\r\n" );\r
415                 sErrorHasOccurred = pdTRUE;\r
416         }\r
417 \r
418         if( xAreAltPollingQueuesStillRunning() != pdTRUE )\r
419         {\r
420                 vDisplayMessage( "Alt polling queue count unchanged!\r\n" );\r
421                 sErrorHasOccurred = pdTRUE;\r
422         }\r
423 \r
424         if( xIsCreateTaskStillRunning() != pdTRUE )\r
425         {\r
426                 vDisplayMessage( "Incorrect number of tasks running!\r\n" );\r
427                 sErrorHasOccurred = pdTRUE;\r
428         }\r
429 \r
430         if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
431         {\r
432                 vDisplayMessage( "Semaphore take count unchanged!\r\n" );\r
433                 sErrorHasOccurred = pdTRUE;\r
434         }\r
435 \r
436         if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
437         {\r
438                 vDisplayMessage( "Dynamic priority count unchanged!\r\n" );\r
439                 sErrorHasOccurred = pdTRUE;\r
440         }\r
441         \r
442         if( xAreMultiEventTasksStillRunning() != pdTRUE )\r
443         {\r
444                 vDisplayMessage( "Error in multi events tasks!\r\n" );\r
445                 sErrorHasOccurred = pdTRUE;\r
446         }\r
447 \r
448         if( xAreFlashCoRoutinesStillRunning() != pdTRUE )\r
449         {\r
450                 vDisplayMessage( "Error in co-routine flash tasks!\r\n" );\r
451                 sErrorHasOccurred = pdTRUE;\r
452         }\r
453 \r
454         if( xAreHookCoRoutinesStillRunning() != pdTRUE )\r
455         {\r
456                 vDisplayMessage( "Error in tick hook to co-routine communications!\r\n" );\r
457                 sErrorHasOccurred = pdTRUE;\r
458         }\r
459 \r
460         if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
461         {\r
462                 vDisplayMessage( "Error in block time test tasks!\r\n" );\r
463                 sErrorHasOccurred = pdTRUE;\r
464         }\r
465 \r
466         if( xAreAltBlockTimeTestTasksStillRunning() != pdTRUE )\r
467         {\r
468                 vDisplayMessage( "Error in fast block time test tasks!\r\n" );\r
469                 sErrorHasOccurred = pdTRUE;\r
470         }\r
471 \r
472         if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
473         {\r
474                 vDisplayMessage( "Error in generic queue test task!\r\n" );\r
475                 sErrorHasOccurred = pdTRUE;             \r
476         }\r
477 \r
478         if( xAreAltGenericQueueTasksStillRunning() != pdTRUE )\r
479         {\r
480                 vDisplayMessage( "Error in fast generic queue test task!\r\n" );\r
481                 sErrorHasOccurred = pdTRUE;             \r
482         }\r
483 \r
484         if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
485         {\r
486                 vDisplayMessage( "Error in queue peek test task!\r\n" );\r
487                 sErrorHasOccurred = pdTRUE;\r
488         }\r
489 \r
490         if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
491         {\r
492                 vDisplayMessage( "Error in counting semaphore demo task!\r\n" );\r
493                 sErrorHasOccurred = pdTRUE;\r
494         }\r
495 \r
496         if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
497         {\r
498                 vDisplayMessage( "Error in recursive mutex tasks!\r\n" );\r
499                 sErrorHasOccurred = pdTRUE;\r
500         }\r
501 \r
502         /* The hook function associated with this task is called each time the task\r
503         is switched in.  We therefore expect the number of times the callback \r
504         function has been executed to have increrment since the last time this \r
505         function executed. */\r
506         if( uxCheckTaskHookCallCount <= uxLastHookCallCount )\r
507         {\r
508                 vDisplayMessage( "Error in task hook call count!\r\n" );\r
509                 sErrorHasOccurred = pdTRUE;\r
510         }\r
511         else\r
512         {\r
513                 uxLastHookCallCount = uxCheckTaskHookCallCount;\r
514         }\r
515 \r
516         /* We would expect some queue sending to occur between calls of this \r
517         function. */\r
518         if( uxQueueSendPassedCount <= uxLastQueueSendCount )\r
519         {\r
520                 vDisplayMessage( "Error in queue send hook call count!\r\n" );\r
521                 sErrorHasOccurred = pdTRUE;\r
522         }\r
523         else\r
524         {\r
525                 uxLastQueueSendCount = uxQueueSendPassedCount;\r
526         }\r
527 \r
528         if( sErrorHasOccurred == pdFALSE )\r
529         {\r
530                 vDisplayMessage( "OK " );\r
531         }\r
532 }\r
533 /*-----------------------------------------------------------*/\r
534 \r
535 static void prvStartMathTasks( void )\r
536 {\r
537         #ifdef BCC_INDUSTRIAL_PC_PORT\r
538                 /* The Borland project does not yet support floating point. */\r
539                 vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
540         #else\r
541                 vStartMathTasks( tskIDLE_PRIORITY );\r
542         #endif\r
543 }\r
544 /*-----------------------------------------------------------*/\r
545 \r
546 static portBASE_TYPE prvCheckMathTasksAreStillRunning( void )\r
547 {\r
548         #ifdef BCC_INDUSTRIAL_PC_PORT\r
549                 /* The Borland project does not yet support floating point. */\r
550                 return xAreIntegerMathsTaskStillRunning();\r
551         #else\r
552                 return xAreMathsTaskStillRunning();\r
553         #endif\r
554 }\r
555 /*-----------------------------------------------------------*/\r
556 \r
557 void vApplicationIdleHook( void )\r
558 {\r
559         /* The co-routines are executed in the idle task using the idle task \r
560         hook. */\r
561         vCoRoutineSchedule();\r
562 }\r
563 /*-----------------------------------------------------------*/\r
564 \r