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