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