]> git.sur5r.net Git - freertos/blobdiff - Demo/PC/main.c
Update version numbers to V4.8.0
[freertos] / Demo / PC / main.c
index f81ec2883ccfe0350b785d1f630301901fcb2767..37bd592669aeb248c92b05c00d54adb3edeee10d 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-       FreeRTOS.org V4.0.4 - Copyright (C) 2003-2006 Richard Barry.\r
+       FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry.\r
 \r
        This file is part of the FreeRTOS.org distribution.\r
 \r
        can be applied.\r
 \r
        ***************************************************************************\r
-       See http://www.FreeRTOS.org for documentation, latest information, license \r
-       and contact details.  Please ensure to read the configuration and relevant \r
-       port sections of the online documentation.\r
        ***************************************************************************\r
+       *                                                                                                                                                 *\r
+       * SAVE TIME AND MONEY!  Why not get us to quote to get FreeRTOS.org               *\r
+       * running on your hardware - or even write all or part of your application*\r
+       * for you?  See http://www.OpenRTOS.com for details.                                      *\r
+       *                                                                                                                                                 *\r
+       ***************************************************************************\r
+       ***************************************************************************\r
+\r
+       Please ensure to read the configuration and relevant port sections of the\r
+       online documentation.\r
+\r
+       http://www.FreeRTOS.org - Documentation, latest information, license and \r
+       contact details.\r
+\r
+       http://www.SafeRTOS.com - A version that is certified for use in safety \r
+       critical systems.\r
+\r
+       http://www.OpenRTOS.com - Commercial support, development, porting, \r
+       licensing and training services.\r
 */\r
 \r
 /**\r
  * <HR>\r
  */\r
 \r
-/*\r
-Changes from V1.00:\r
-\r
-       + Prevent the call to kbhit() for debug builds as the debugger seems to\r
-         have problems stepping over the call.\r
-\r
-Changes from V1.2.3\r
-\r
-       + The integer and comtest tasks are now used when the cooperative scheduler \r
-         is being used.  Previously they were only used with the preemptive\r
-         scheduler.\r
-\r
-Changes from V1.2.6\r
-\r
-       + Create new tasks as defined by the new demo application file dynamic.c.\r
-\r
-Changes from V2.0.0\r
-\r
-       + Delay periods are now specified using variables and constants of\r
-         portTickType rather than unsigned portLONG.\r
-\r
-Changes from V3.1.1\r
-\r
-       + The tasks defined in the new file "events.c" are now created and \r
-         monitored for errors. \r
-\r
-Changes from V3.2.4\r
-\r
-       + Now includes the flash co-routine demo rather than the flash task demo.\r
-         This is to demonstrate the co-routine functionality.\r
-*/\r
-\r
 #include <stdlib.h>\r
 #include <conio.h>\r
 #include "FreeRTOS.h"\r
@@ -115,6 +99,15 @@ Changes from V3.2.4
 #include "dynamic.h"\r
 #include "mevents.h"\r
 #include "crhook.h"\r
+#include "blocktim.h"\r
+#include "AltBlock.h"\r
+#include "GenQTest.h"\r
+#include "QPeek.h"\r
+#include "countsem.h"\r
+#include "AltQTest.h"\r
+#include "AltPollQ.h"\r
+#include "AltBlckQ.h"\r
+#include "RecMutex.h"\r
 \r
 /* Priority definitions for the tasks in the demo application. */\r
 #define mainLED_TASK_PRIORITY          ( tskIDLE_PRIORITY + 1 )\r
@@ -124,6 +117,7 @@ Changes from V3.2.4
 #define mainQUEUE_BLOCK_PRIORITY       ( tskIDLE_PRIORITY + 3 )\r
 #define mainCOM_TEST_PRIORITY          ( tskIDLE_PRIORITY + 2 )\r
 #define mainSEMAPHORE_TASK_PRIORITY    ( tskIDLE_PRIORITY + 1 )\r
+#define mainGENERIC_QUEUE_PRIORITY     ( tskIDLE_PRIORITY )\r
 \r
 #define mainPRINT_STACK_SIZE           ( ( unsigned portSHORT ) 512 )\r
 #define mainDEBUG_LOG_BUFFER_SIZE      ( ( unsigned portSHORT ) 20480 )\r
@@ -149,7 +143,7 @@ being used. */
 #endif\r
 \r
 /* Constant definition used to turn on/off the pre-emptive scheduler. */\r
-static const portSHORT sUsingPreemption = pdTRUE;\r
+static const portSHORT sUsingPreemption = configUSE_PREEMPTION;\r
 \r
 /* Start the math tasks appropriate to the build.  The Borland port does\r
 not yet support floating point so uses the integer equivalent. */\r
@@ -171,11 +165,19 @@ portSHORT main( void )
        vStartComTestTasks( mainCOM_TEST_PRIORITY, serCOM1, ser115200 );\r
        vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
        vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );\r
-       \r
+       vCreateBlockTimeTasks();\r
+       vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
        vStartSemaphoreTasks( mainSEMAPHORE_TASK_PRIORITY );\r
        vStartDynamicPriorityTasks();\r
        vStartMultiEventTasks();\r
-\r
+       vStartQueuePeekTasks();\r
+       vStartCountingSemaphoreTasks();\r
+       vStartAltGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
+       vCreateAltBlockTimeTasks();\r
+       vStartAltBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );        \r
+       vStartAltPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
+       vStartRecursiveMutexTasks();\r
+               \r
        /* Create the "Print" task as described at the top of the file. */\r
        xTaskCreate( vErrorChecks, "Print", mainPRINT_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );\r
 \r
@@ -338,12 +340,24 @@ static portSHORT sErrorHasOccurred = pdFALSE;
                sErrorHasOccurred = pdTRUE;\r
        }\r
 \r
+       if( xAreAltBlockingQueuesStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Alt blocking queues count unchanged!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
        if( xArePollingQueuesStillRunning() != pdTRUE )\r
        {\r
                vDisplayMessage( "Polling queue count unchanged!\r\n" );\r
                sErrorHasOccurred = pdTRUE;\r
        }\r
 \r
+       if( xAreAltPollingQueuesStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Alt polling queue count unchanged!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
        if( xIsCreateTaskStillRunning() != pdTRUE )\r
        {\r
                vDisplayMessage( "Incorrect number of tasks running!\r\n" );\r
@@ -380,6 +394,48 @@ static portSHORT sErrorHasOccurred = pdFALSE;
                sErrorHasOccurred = pdTRUE;\r
        }\r
 \r
+       if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in block time test tasks!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
+       if( xAreAltBlockTimeTestTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in fast block time test tasks!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
+       if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in generic queue test task!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;             \r
+       }\r
+\r
+       if( xAreAltGenericQueueTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in fast generic queue test task!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;             \r
+       }\r
+\r
+       if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in queue peek test task!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
+       if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in counting semaphore demo task!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
+       if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
+       {\r
+               vDisplayMessage( "Error in recursive mutex tasks!\r\n" );\r
+               sErrorHasOccurred = pdTRUE;\r
+       }\r
+\r
        if( sErrorHasOccurred == pdFALSE )\r
        {\r
                vDisplayMessage( "OK " );\r