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